Click here to Skip to main content
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 3-Dec-12 0:53am
Edited 3-Dec-12 1: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
0 OriginalGriff 230
1 PIEBALDconsult 150
2 DamithSL 125
3 BillWoodruff 108
4 Garth J Lancaster 90
0 OriginalGriff 5,790
1 DamithSL 4,601
2 Maciej Los 4,012
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,195


Advertise | Privacy | Mobile
Web04 | 2.8.141220.1 | Last Updated 3 Dec 2012
Copyright © CodeProject, 1999-2014
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