Resizing the form will call your screenshot function multiple times within a very short time periode. The
CopyRect
/
BitBlt
screenshot method is not recommended on newer Windows versions, as this code is already very slow itself (this will copy the complete desktop contents from the video memory to the CPU memory every time). You might be able to reduce flickering by using some kind of double-buffering, but I would recommend you to use the
Desktop Duplication API introduced in Windows 8.