Watermark Code

Use this board to post your code snippets - tips and tricks
5 posts Page 1 of 1
Contributors
User avatar
hungryhounduk
VIP - Site Partner
VIP - Site Partner
Posts: 2870
Joined: Mon Jul 27, 2009 11:58 am

Watermark Code
hungryhounduk
Hey All
Here is a WATERMARK CODE that was all done by Codenstuff for me cooll; for my Button Express App way back when i first Joined this Fantastic Site wahooo; wahooo;

This works by using 2 Panels, 1 for the Button/Image to sit in, and 1 for the Watermark, and if you look at the code below I had this working by coding it onto a SAVE Button with my Image already in the Panel, but you can rework the code to make it your own...

**Where it says "YOUR WATERMARK TEXT HERE" Change that to what you want the Watermark to say.

Enjoy :)

***So all Credit goes to Codenstuff***
Code: Select all
Dim savefiledialog1 As New SaveFileDialog
        savefiledialog1.Title = "Save File"
        savefiledialog1.FileName = "*.png"
        savefiledialog1.Filter = "PNG |*.png"
        If savefiledialog1.ShowDialog() = DialogResult.OK Then
            Dim myBrush As Brush
            myBrush = New SolidBrush(Color.FromArgb(64, Color.White))
            Dim bmap As Bitmap = New Bitmap(Panel1.BackgroundImage)
            Dim g As Graphics = Graphics.FromImage(bmap)
            Dim deg = -45.0F
            g.RotateTransform(deg)
            g.DrawString("YOUR WATERMARK TEXT HERE", New Font("Verdana", 15, FontStyle.Regular), myBrush, -100, 100)
            Panel1.BackgroundImage = bmap
            g.Dispose()
            Dim bmp As New Drawing.Bitmap(Panel2.Width, Panel2.Height)
            Panel2.DrawToBitmap(bmp, New Rectangle(0, 0, bmp.Width, bmp.Height))
            bmap.Save(savefiledialog1.FileName, Imaging.ImageFormat.Png)
        End If
Happy Watermarking

Chris
Image
Lewis
Coding God
Coding God
Posts: 1564
Joined: Sun Dec 20, 2009 2:12 pm

Re: Watermark Code
Lewis
Your a year late.. haha, but this is a good code, if i'm correct there was also a code submitted a few days back...
Image
User avatar
CodenStuff
Site Admin
Site Admin
Posts: 4389
Joined: Tue Aug 04, 2009 1:47 am

Re: Watermark Code
CodenStuff
lol I vaguely remember something about this..hope you havent given up on the button maker type application cooll;
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
User avatar
hungryhounduk
VIP - Site Partner
VIP - Site Partner
Posts: 2870
Joined: Mon Jul 27, 2009 11:58 am

Re: Watermark Code
hungryhounduk
Your a year late.. haha, but this is a good code, if i'm correct there was also a code submitted a few days back...
Yeah I saw that Post, But people were cussing about the Code not being his (or whatever) so i dug this out as i thought it might be Handy and was all done by our own Code Guru Codenstuff cooll; wahooo; wahooo; wahooo;
lol I vaguely remember something about this..hope you havent given up on the button maker type application
Too be Honest I was looking for it the Other day as i wanted to Check some of the code for a new app i am thinking of doing, But Guess what?? Could i find it :? I have so much stuff on External Harddrives and like an Idiot i always seen to duplicate saving stuff so searching for old things i have done can be a real Pain. But hopefully i will come across it sometime soon 8-)


Chris
Image
User avatar
zachman61
VIP - Donator
VIP - Donator
Posts: 1891
Joined: Wed Dec 16, 2009 9:56 pm

Re: Watermark Code
zachman61
hungryhounduk wrote:
Your a year late.. haha, but this is a good code, if i'm correct there was also a code submitted a few days back...
Yeah I saw that Post, But people were cussing about the Code not being his (or whatever) so i dug this out as i thought it might be Handy and was all done by our own Code Guru Codenstuff cooll; wahooo; wahooo; wahooo;
lol I vaguely remember something about this..hope you havent given up on the button maker type application
Too be Honest I was looking for it the Other day as i wanted to Check some of the code for a new app i am thinking of doing, But Guess what?? Could i find it :? I have so much stuff on External Harddrives and like an Idiot i always seen to duplicate saving stuff so searching for old things i have done can be a real Pain. But hopefully i will come across it sometime soon 8-)


Chris
just put some masking tape on one side labeled PROGRAMMIN'
But to the code
how long ago did you two make this?
haha
Nailing my feet to the floor is easier than using my own muscles to balance, but you don't see me doing that :)
5 posts Page 1 of 1
Return to “Quick Snips”