Available in the LEADTOOLS Imaging toolkit. |
BackErase example for Visual J++
This example turns off repainting of the background, then zooms out to show the effect when repainting.
LEAD1.setBackErase( false );
LEAD1.setAutoRepaint( false );
LEAD1.setAutoScroll( false );
// Calculate the values to zoom out by 10 percent and center the image.
LEAD1.setDstWidth( LEAD1.getDstWidth() * 0.9f );
LEAD1.setDstHeight( LEAD1.getDstHeight() * 0.9f );
LEAD1.setDstTop( (LEAD1.getScaleHeight() - LEAD1.getDstHeight() ) / 2 );
LEAD1.setDstLeft( (LEAD1.getScaleWidth() - 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();