Is there a way to re-size a transparent image in windows mobile(C#)? I can re-size the image but I am losing the transparency. It is being replaced with white.
Here is what I have now
public static void ResizePicture(string imageFileName, Size maxSize)
{
using (Image src = new Bitmap(imageFileName))
{
using (Bitmap dst = new Bitmap(maxSize.Width, maxSize.Height))
{
using (Graphics g = Graphics.FromImage(dst))
{
ImageAttributes imageAttr = new ImageAttributes();
g.Clear(Color.Transparent);
g.DrawImage(src, new Rectangle(0, 0, dst.Width, dst.Height), 0, 0, src.Width, src.Height, GraphicsUnit.Pixel, imageAttr);
}
dst.Save(imageFileName, ImageFormat.Png);
}
}
}