Click here to Skip to main content
11,629,371 members (64,382 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#4.0 VS2010 WinForm
Hi,
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");
}

-----------------------------------------------------------------------------
Regards,
Karthikeyan,Bangalore
Posted 2-Dec-12 23:53pm
Edited 3-Dec-12 0:41am
v4
Comments
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
good
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
  Permalink  
Comments
pkarthionline at 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)

  Print Answers RSS


Advertise | Privacy | Mobile
Web02 | 2.8.150723.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