Shadow Text Maker
Heres your chance to share your own tutorials with the community. Just post them on here. If your lucky they may even be posted on the main site.
Hello,
Its cold and snowing outside so while im inside keeping warm I decided to catch up on some overdue tutorials that people have been asking me to do for them. So here is a strange little application that turns your text into a nice image.
First start a new project and add the following controls to your main form:
PictureBox
4 Buttons
TextBox
ColorDialog
FontDialog
Now place the controls on your form however you like them and just to give you an idea of what the controls do heres a screenshot from the attached source-code: OK once you have done your controls we need to get the code done so first enter these imports:
Download Source-Code: Happy coding! cooll;
Its cold and snowing outside so while im inside keeping warm I decided to catch up on some overdue tutorials that people have been asking me to do for them. So here is a strange little application that turns your text into a nice image.
First start a new project and add the following controls to your main form:
PictureBox
4 Buttons
TextBox
ColorDialog
FontDialog
Now place the controls on your form however you like them and just to give you an idea of what the controls do heres a screenshot from the attached source-code: OK once you have done your controls we need to get the code done so first enter these imports:
Code: Select all
Then below "Public Class Form.." add this code:Imports System
Imports System.Drawing
Imports System.Windows.Forms
Imports System.Drawing.Text
Imports System.Drawing.Drawing2D
Code: Select all
We are going to use Button1 to change the color of our text so in the "Click_event" add this code: Inherits System.Windows.Forms.Form
Private ConvertedTextImage As Bitmap
Private Const ShadowIntense As Integer = 6
Dim TextColor = Color.Blue, ShadowColor = Color.Gray
Dim TextFont As New Font("Arial", 20, FontStyle.Bold)
Protected Overloads Overrides Sub OnPaint(ByVal e As PaintEventArgs)
PictureBox1.Image = ConvertedTextImage
MyBase.OnPaint(e)
End Sub
Code: Select all
and we are going to use Button2 to change the color of our texts shadow so in the "Click_event" add this code:If ColorDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
TextColor = ColorDialog1.Color
End If
Code: Select all
Button3 will be used to change our texts font so again in the "Click_event" add this code:If ColorDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
ShadowColor = ColorDialog1.Color
End If
Code: Select all
now we use Button4 to generate our image from our text so add this code in its "Click_event": If FontDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
TextFont = FontDialog1.Font
End If
Code: Select all
Finally we need our actual function that will turn our plain text into an image so add this code block just above "End Class":ConvertedTextImage = DirectCast(TextToShadowImage(TextBox1.Text, TextFont, TextColor, ShadowColor), Bitmap)
Code: Select all
Save build and run the application and you should now have a working shadow text maker.Public Shared Function TextToShadowImage(ByVal InText As String, ByVal TextFontStyle As Font, ByVal TColor As Color, ByVal SColor As Color) As Image
Dim ShadowTextOutput As Bitmap = Nothing
Using g As Graphics = Graphics.FromHwnd(IntPtr.Zero)
Dim STSize As SizeF = g.MeasureString(InText, TextFontStyle)
Using bmp As New Bitmap(CInt(STSize.Width), CInt(STSize.Height))
Using gBmp As Graphics = Graphics.FromImage(bmp)
Using BrushBackground As New SolidBrush(Color.FromArgb(16, SColor.R, SColor.G, SColor.B))
Using BrushForground As New SolidBrush(TColor)
gBmp.SmoothingMode = SmoothingMode.HighQuality
gBmp.InterpolationMode = InterpolationMode.HighQualityBilinear
gBmp.TextRenderingHint = TextRenderingHint.AntiAliasGridFit
gBmp.DrawString(InText, TextFontStyle, BrushBackground, 0, 0)
ShadowTextOutput = New Bitmap(bmp.Width + ShadowIntense, bmp.Height + ShadowIntense)
Using gBmpOut As Graphics = Graphics.FromImage(ShadowTextOutput)
gBmpOut.SmoothingMode = SmoothingMode.HighQuality
gBmpOut.InterpolationMode = InterpolationMode.HighQualityBilinear
gBmpOut.TextRenderingHint = TextRenderingHint.AntiAliasGridFit
For x As Integer = 0 To ShadowIntense
For y As Integer = 0 To ShadowIntense
gBmpOut.DrawImageUnscaled(bmp, x, y)
Next
Next
gBmpOut.DrawString(InText, TextFontStyle, BrushForground, ShadowIntense / 2, ShadowIntense / 2)
End Using
End Using
End Using
End Using
End Using
End Using
Return ShadowTextOutput
End Function
Download Source-Code: Happy coding! cooll;
You do not have the required permissions to view the files attached to this post.
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
Hi Codenstuff
Nice cooll; wahooo;
You always seem to amaze me with these Great apps cooll;
Chris
Nice cooll; wahooo;
You always seem to amaze me with these Great apps cooll;
Chris
Love this
Also im going to combine this with a button express clone i made :P

Great Job But it Seems More of an Outline
Great app codenstuff
but so sad its not working with me.
nothing happens.
any idea?
Dummy1912
but so sad its not working with me.
nothing happens.
any idea?
Dummy1912
visit us on:
http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
Great tutorial Craig!! I'll use this in my Text Editor.
Instead of LOL use this -
LSIBMHBIWFETALOL
Which means -
Laughing silently in between my head because it wasn't funny enough to actually laugh out loud!
LSIBMHBIWFETALOL
Which means -
Laughing silently in between my head because it wasn't funny enough to actually laugh out loud!
When i change the text nothing happens :/ When i click create button, also nothing happens :/
I think if it stats working for me i can rewrite your code into creating captcha-s 

Its not hard to create captchas, tommorrow ill post my generator. It would be alot different than others.
LMAOSHMSFOAIDMT
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;
Over 30 projects with source code!
Please give reputation to helpful members!
![Image]()
![Image]()
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;
Over 30 projects with source code!
Please give reputation to helpful members!


Copyright Information
Copyright © Codenstuff.com 2020 - 2023