I recently learned about the need to dispose of GDI objects because the GC does not care about them like other objects in C #. I have bitmaps that I would like to get throughout my life forms, but I'm not sure about some things ...
When recreating a bitmap object, do I need to delete the original object first? I do not think, but I thought I would check. For instance:
Bitmap bmp;
bmp = new Bitmap(source);
if(bmp != null) {
bmp.Dispose
bmp = null
}
bmp = new Bitmap(source2);
DrawImage(bmp, rectangle);
Since I want to save bitmaps for the life time of the form, can I just get rid of them in the form closing event?
Is there a better alternative than saving raster images? Creating each bitmap from a file and removing paint is too slow. Using Image instead of Bitmap reduces image quality.
Thanks in advance!