Click here to Skip to main content
11,789,706 members (62,748 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: C#4.0 VS2010 WinForm
How to change web page code C# to win form c# code.
<pre lang="cs">protected void btnAddWatermark_Click(object sender, EventArgs e)

Bitmap bmpStamp = new Bitmap(Server.MapPath("Images") + "\\" + "copyright.png");
Bitmap bmpUpload = new Bitmap(upld.PostedFile.InputStream, false);
   Graphics graphicsObj = Graphics.FromImage(bmpUpload);
Point postionWaterMark = new Point((bmpUpload.Width / 10), (bmpUpload.Height / 10));
graphicsObj.DrawImage(bmpStamp, postionWaterMark);
bmpUpload.Save(Server.MapPath("Images") + "\\" + 
System.IO.Path.GetFileName(upld.PostedFile.FileName) + ".jpg");

Posted 2-Dec-12 23:53pm
Edited 3-Dec-12 0:41am
Mendor81 at 3-Dec-12 6:12am
What exactly is the problem?
pkarthionline at 3-Dec-12 6:47am
web code to winform code?
Mendor81 at 3-Dec-12 6:50am
So you want to add watermark to a file, on a server? on a local path? in a picturebox in winforms?
pkarthionline at 3-Dec-12 7:04am
I want local path picture to add watermark in picture box .

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

you can have a look here:

Build a Simple Watermarking Utility in C#[^]

it may give you a hint
pkarthionline at 3-Dec-12 7:12am

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 999
1 Maciej Los 765
2 KrunalRohit 686
3 CPallini 606
4 Richard MacCutchan 430

Advertise | Privacy | Mobile
Web03 | 2.8.1509028.1 | Last Updated 3 Dec 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100