Page 1 of 1

Watermark to a picture (video)(with source code)

Posted: Tue Aug 16, 2011 3:42 pm
by Danny
\
I KNOW I FORGOT SOMETHING ;o

Re: Watermark to a picture (video)(with source code)

Posted: Tue Aug 16, 2011 4:33 pm
by MrAksel
himeji-jo wrote:
Code: Select all
code:
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)
It wont work if you use the graphics from the control and not its image... We just had a topic about this.
You need the graphics from the image!
Code: Select all
Dim GFX As Graphics = Graphics.FromImage(PictureBox1.Image)
GFX.DrawString(TextBox1.Text, NF, NB, 15, 135)
GFX.Dispose 'Reduce memory loss

Re: Watermark to a picture (video)(with source code)

Posted: Tue Aug 16, 2011 4:37 pm
by Danny
MrAksel wrote:
himeji-jo wrote:
Code: Select all
code:
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)
It wont work if you use the graphics from the control and not its image... We just had a topic about this.
You need the graphics from the image!
Code: Select all
Dim GFX As Graphics = Graphics.FromImage(PictureBox1.Image)
GFX.DrawString(TextBox1.Text, NF, NB, 15, 135)
GFX.Dispose 'Reduce memory loss
oops forgot that!

Re: Watermark to a picture (video)(with source code)

Posted: Tue Aug 16, 2011 4:37 pm
by Zulf
I thought we already explained to him about this..:S

Re: Watermark to a picture (video)(with source code)

Posted: Tue Aug 16, 2011 5:12 pm
by MrAksel
Yea its just that. Lol had a hard knock in your head lately?

Re: Watermark to a picture (video)(with source code)

Posted: Tue Aug 16, 2011 5:18 pm
by Zulf
Should we give him the clamps? (Futurama reference)

Re: Watermark to a picture (video)(with source code)

Posted: Tue Aug 16, 2011 5:27 pm
by Danny
Zulf wrote:
I thought we already explained to him about this..:S
sorry ;o I am just tired ;o and forgot that piece of code

Re: Watermark to a picture (video)(with source code)

Posted: Tue Aug 16, 2011 5:29 pm
by Danny
what?

Re: Watermark to a picture (video)(with source code)

Posted: Fri Aug 19, 2011 9:14 pm
by 2cool4cereal2
"Not my clampin' hand, they took my clampin' hand!"

Anyways, neat tutorial, I think it would be good for a paint-like application.