Available in the LEADTOOLS Imaging toolkit. |
SetSrcClipRect example for Visual J++
This example crops the image by reducing the source clipping area and repaints the image.
int nNewLeft = (int) ( LEAD1.getSrcClipLeft() + ( LEAD1.getSrcClipWidth() * 0.1f ) );
int nNewTop = (int) ( LEAD1.getSrcClipTop() + ( LEAD1.getSrcClipHeight() * 0.1f ) );
int nNewWidth = (int) ( LEAD1.getSrcClipWidth() * 0.8f );
int nNewHeight = (int) ( LEAD1.getSrcClipHeight() * 0.8f );
if( nNewWidth > 1 && nNewHeight >1 )
LEAD1.SetSrcClipRect( nNewLeft, nNewTop, nNewWidth, nNewHeight );
LEAD1.ForceRepaint();