Transparent Background Color

Jul 11, 2011 at 11:10 PM

It would be nice if it was possible to export an image with Transparency.

I am currently exporting an image with the following code, but am unable to get a transparent background color.

 

    Bitmap bitmap = new Bitmap(map.MapFrame.ImageRectangle.Width, map.MapFrame.ImageRectangle.Height);
            map.BackColor = Color.Transparent;
            map.DrawToBitmap(bitmap, map.ClientRectangle);
            Image img = bitmap;
            
            string fileName = @"c:\Temp\test" + Guid.NewGuid().ToString() + ".png";
            img.Save(fileName, System.Drawing.Imaging.ImageFormat.Png);
            Console.WriteLine(fileName);

 

I think you can make the control have a transparent bg in the source code if you applied the following code linked below.

http://msdn.microsoft.com/en-us/library/wk5b13s4.aspx

 

Anyways.. It would be a nice addition.

 

Drew