Editing Images on the fly...
-
i would like to implement a ihttphandler to handle all image request in a particular folder so i an add a "watermark" to the images, i have it working great for jpegs, pngs and bmps... problem is gifs, especially animated gifs... how can i watermark these on the fly? i cannot seem to open the gifs into a Graphic object, thanks!
-
i would like to implement a ihttphandler to handle all image request in a particular folder so i an add a "watermark" to the images, i have it working great for jpegs, pngs and bmps... problem is gifs, especially animated gifs... how can i watermark these on the fly? i cannot seem to open the gifs into a Graphic object, thanks!
You can create a new
Bitmap
from a file path or aStream
. UseGraphics.FromImage
to get aGraphics
object for that image. Keep in mind, however, that GIFs are indexed images and require a palette. If you're using different colors other than what exists in teh palette, you'll need to generate a new palette from the existing one and add the colors you need.Microsoft MVP, Visual C# My Articles