I have a bitmap object and draw some curves on it by setpixel method. when I save this bitmap as jpg file, the background of my picture is not a white surface. the background is transparent. what is the problem? How can I resolve this problem?
Share
Call
Graphics.Clear(Color.White)before you draw on the bitmap. If you do not already have an instance ofSystem.Drawing.Graphicsfor your bitmap, here’s how to get one:Clear the bitmap:
And of course, don’t forget to call
Dispose()when you are done with the graphics.