Watermark to a picture (video)(with source code)
Posted: Tue Aug 16, 2011 3:42 pm
\
I KNOW I FORGOT SOMETHING ;o
Sharing, Teaching and Supporting coders of all ages and levels since 2009
https://www.codenstuff.com/forum/
himeji-jo wrote:It wont work if you use the graphics from the control and not its image... We just had a topic about this.Code: Select allcode: Dim NF As New Font("Impact", 36, FontStyle.Italic) Dim NB As New SolidBrush(Color.FromArgb(64, 192, 255, 255)) NB.Color = Color.FromArgb(128, 0, 0, 0) PictureBox1.CreateGraphics.DrawString(TextBox1.Text, NF, NB, 15, 135)
Dim GFX As Graphics = Graphics.FromImage(PictureBox1.Image)
GFX.DrawString(TextBox1.Text, NF, NB, 15, 135)
GFX.Dispose 'Reduce memory loss
MrAksel wrote:oops forgot that!himeji-jo wrote:It wont work if you use the graphics from the control and not its image... We just had a topic about this.Code: Select allcode: Dim NF As New Font("Impact", 36, FontStyle.Italic) Dim NB As New SolidBrush(Color.FromArgb(64, 192, 255, 255)) NB.Color = Color.FromArgb(128, 0, 0, 0) PictureBox1.CreateGraphics.DrawString(TextBox1.Text, NF, NB, 15, 135)
You need the graphics from the image!Code: Select allDim GFX As Graphics = Graphics.FromImage(PictureBox1.Image) GFX.DrawString(TextBox1.Text, NF, NB, 15, 135) GFX.Dispose 'Reduce memory loss
Zulf wrote:I thought we already explained to him about this..:Ssorry ;o I am just tired ;o and forgot that piece of code