Click here to Skip to main content
13,149,073 members (53,884 online)
Rate this:
Please Sign up or sign in to vote.
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
Updated 3-Dec-12 0:41am
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

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 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
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web02 | 2.8.170924.2 | Last Updated 3 Dec 2012
Copyright © CodeProject, 1999-2017
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