BackErase example for Delphi
This example turns off repainting of the background, then zooms out to show the effect when repainting.
Lead1.BackErase := False;
Lead1.AutoRepaint := False;
Lead1.AutoScroll := False;
{Calculate the values to zoom out by 10 percent and center the image.}
Lead1.DstWidth := Round(Lead1.DstWidth * 0.9);
Lead1.DstHeight := Round(Lead1.DstHeight * 0.9);
Lead1.DstTop := (Lead1.Height - Lead1.DstHeight) div 2;
Lead1.DstLeft := (Lead1.Width - Lead1.DstWidth) div 2;
{Set the clipping area to the same as the destination rectangle}
Lead1.DstClipWidth := Lead1.DstWidth;
Lead1.DstClipHeight := Lead1.DstHeight;
Lead1.DstClipTop := Lead1.DstTop;
Lead1.DstClipLeft := Lead1.DstLeft;
{Redisplay the image}
Lead1.ForceRepaint;