.jpg watermarking

B

Bob

I have some JPG files on my website. I'd like to know if there is a way to
dynamically watermark these images before I display them on the website.

I'm running ASP.NET 2.0 C#.

Thank you very much.
 
?

=?iso-8859-1?Q?Gabriel_Maga=F1a?=

You could take some free code like http://www.codeproject.com/csharp/watermark.asp , and stream it to the client instead of making an actual jpg file. You would reference your image as <img src="watermark.aspx?id=9345" /> or somethign similar.

watermark.aspx would be a blank aspx page where all the work would be done in the codebehind on the page_load handler. It would have a piece of code like this:

// Change the response headers to output a JPEG image
this.Response.Clear();
this.Response.ContentType = "image/jpeg";
// Stream data here

That's a basic overview, but enough to get you started... Of course, it would be easier if you watermark your images before the fact that way you do not waste CPU time doing it over and over (plus you get to display the images at design time).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top