Src... example for C++ Builder

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) && (Lead1->SrcHeight > 1))
{
    Lead1->SrcWidth = Lead1->SrcWidth * 0.9;
    Lead1->SrcHeight = Lead1->SrcHeight * 0.9;
    Lead1->SrcTop = (Lead1->BitmapHeight - Lead1->SrcHeight) / 2;
    Lead1->SrcLeft = (Lead1->BitmapWidth - Lead1->SrcWidth) / 2;
}
/*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();