Available in the LEADTOOLS Imaging toolkit. |
Dst... example for Visual J++
// Set variables for the client area of the control.
int nClHeight = (int) LEAD1.getScaleHeight();
int nClWidth = (int) LEAD1.getScaleWidth();
// Calculate the values to zoom in by 10 percent and center the image.
LEAD1.setDstWidth( LEAD1.getDstWidth() * 1.1f );
LEAD1.setDstHeight( LEAD1.getDstHeight() * 1.1f );
LEAD1.setDstTop( ( nClHeight - LEAD1.getDstHeight() ) / 2 );
LEAD1.setDstLeft( ( nClWidth - LEAD1.getDstWidth() ) / 2 );
// Set the clipping area to the same as the destination rectangle
LEAD1.setDstClipWidth( LEAD1.getDstWidth() );
LEAD1.setDstClipHeight( LEAD1.getDstHeight() );
LEAD1.setDstClipTop( LEAD1.getDstTop() );
LEAD1.setDstClipLeft( LEAD1.getDstLeft() );
// Redisplay the image
LEAD1.ForceRepaint();