Click here to Skip to main content
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 3-Dec-12 0:53am
Edited 3-Dec-12 1: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 476
1 Sergey Alexandrovich Kryukov 210
2 CHill60 195
3 F-ES Sitecore 120
4 TheRealSteveJudge 120
0 Sergey Alexandrovich Kryukov 9,061
1 OriginalGriff 7,920
2 Peter Leow 4,774
3 Kornfeld Eliyahu Peter 3,210
4 Maciej Los 2,176

Advertise | Privacy | Mobile
Web01 | 2.8.150327.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