Ziad Ahmed
Ziad Ahmed

Reputation: 83

VB.NET watermark on a picture

I asked earlier about a way to add a watermark to a picture using visual basic . and thanks to everybody i managed to find a way , but now it seems like I need a code for an option to make the user select the coordinates of the new watermark position on the picture.

Here is my code

Dim Image1 As New Bitmap(OpenFileDialog1.FileName)
Dim Image2 As New Bitmap(PictureBox1.Image)
Dim Result As New Bitmap(Math.Max(Image1.Width, Image2.Width), _
    Image1.Height + Image2.Height)
Dim gResult As Graphics = Graphics.FromImage(Result)
gResult.DrawImage(Image1, New Point(0, 0))
gResult.DrawImage(Image2, New Point(0, Image1.Height))
gResult.Dispose()
gResult = Nothing


PictureBox5.Image = Result

Upvotes: 1

Views: 2095

Answers (1)

Ziad Ahmed
Ziad Ahmed

Reputation: 83

i found a way to do it . you can use 2 pictureboxes and add a code to move the watermark picturebox . you can save everything at the end using a screenshot method .

Upvotes: 1

Related Questions