Click here to Skip to main content
15,504,830 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,
How to change web page code C# to win form c# code.
C#
----------------------------------------------------------------

<pre lang="cs">protected void btnAddWatermark_Click(object sender, EventArgs e)
           {


C#
Bitmap bmpStamp = new Bitmap(Server.MapPath("Images") + "\\" + "copyright.png");

C#
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);

C#
bmpUpload.Save(Server.MapPath("Images") + "\\" + 
C#
System.IO.Path.GetFileName(upld.PostedFile.FileName) + ".jpg");
}


-----------------------------------------------------------------------------
Regards,
Karthikeyan,Bangalore
Posted
Updated 3-Dec-12 1:41am
v4
Comments
Mendor81 3-Dec-12 6:12am    
What exactly is the problem?
pkarthionline 3-Dec-12 6:47am    
web code to winform code?
Mendor81 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 3-Dec-12 7:04am    
I want local path picture to add watermark in picture box .

1 solution

you can have a look here:

Build a Simple Watermarking Utility in C#[^]

it may give you a hint
 
Share this answer
 
Comments
pkarthionline 3-Dec-12 7:12am    
Thanks

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900