I've got a series of GIFs that I need to crop on the fly, I'm using a HTTP Handler in C# so I can better encapsulate the code - provide caching for the result etc.
Currently, when I draw the existing image to a new
Image via the
Graphics object all the transparency is lost.
I've tried various techniques to try and maintain the transparency, but to no avail.
Things I've tried:
- Using the
MakeTransparent (Color)method call
- Using the
ImageAttriuteswith a combination of
I don't really want to start using unsafe operators or Win32 calls.
How can I configure ASP.Net membership providers through code?
ASP.net Page Loading popup
ContentType doesnt work, mime=application/octet-stream
Html To Doc(Word) Or RTF Format
Showing/Hiding div CollapsePanel after ClientScript.RegisterClientScriptBlock
ASP.net Page object null when invoking it from within templated control
Exposing .NET WebService to Other Platform (Java)
Web Service For Database/Website Status
Of course if you cannot move away from the
System.Drawing.Image SourceImage = System.Drawing.Image.FromFile("the.gif"); System.Drawing.Bitmap NewImage = new System.Drawing.Bitmap(SourceImage); // Do Processing NewImage.MakeTransparent(); // Store changes NewImage.Save(..., System.Drawing.Imaging.ImageFormat.Png);
Graphicsobject then that may not be of much use..