... only work, if You RESTORE the original brush of the window or dialog inside the used area BEFORE painting new images. Using Your sample, You can REFILL the used area with green, before painting the new images. It can be a colored bitmap ( green ) with the size of the used area. A other solution ...