Quote:
|
If I set CloneFirst =True, the image is displayed as expected. If i Set CloneFirst =False the image is displayed pixelated.
|
I don't see how, your getBitMap method returns BottomImage.Clone no matter what CloneFirst parameter is.
Quote:
|
Are Cloned Images Disjoint From original Image?
|
Yes.
You have commented out some Dispose calls here, Graphics instances created from FromImage must be disposed when done using them, image/bitmap objects must also be disposed after use. So otherImage.Dispose() and CopiedImageGraphics.Dispose() is needed in getBitMap method. In btnDisplay_Click method you need to dispose the image object held by newBitMap variable, and if pbImage.Image already contains an image you must dispose that before assigning it a new image object. imageFile.OpenRead returns a FileStream object, you have to close/dispose this when done using it also. In general you have to analyse your code to make sure you don't open/create objects and just leave them in memory after last reference is released without disposing/closing them properly.