Src... example for Delphi
This example uses the source rectangle properties to zoom in on the image.
{Calculate the values to zoom in by 10 percent and center the image.}
If (Lead1.SrcWidth > 1) And (Lead1.SrcHeight > 1) Then
begin
Lead1.SrcWidth := Round(Lead1.SrcWidth * 0.9);
Lead1.SrcHeight := Round(Lead1.SrcHeight * 0.9);
Lead1.SrcTop := Round((Lead1.BitmapHeight-Lead1.SrcHeight) / 2);
Lead1.SrcLeft := Round((Lead1.BitmapWidth-Lead1.SrcWidth) / 2);
end;
{Set the clipping area to the same as the destination rectangle}
Lead1.SrcClipWidth := Lead1.SrcWidth;
Lead1.SrcClipHeight := Lead1.SrcHeight;
Lead1.SrcClipTop := Lead1.SrcTop;
Lead1.SrcClipLeft := Lead1.SrcLeft;
{Redisplay the image}
Lead1.ForceRepaint;