Combine example for Visual J++

This example copies the Lead1 bitmap to Lead2, trims and filters the copied image, and combines the filtered image with the original Lead1 bitmap image. Trimming Lead2 lets you see the difference between filtered and nonfiltered regions.

setCursor( Cursor.WAIT );  // hourglass
LEAD2.setBitmap( LEAD1.getBitmap() );
int nTrimLeft   = (int) ( LEAD2.getBitmapWidth()  * 0.2f );
int nTrimTop    = (int) ( LEAD2.getBitmapHeight() * 0.2f );
int nTrimWidth  = (int) ( LEAD2.getBitmapWidth()  * 0.6f );
int nTrimHeight = (int) ( LEAD2.getBitmapHeight() * 0.6f );
LEAD2.Trim( nTrimLeft, nTrimTop, nTrimWidth, nTrimHeight );
LEAD2.SpatialFilter( (short) LTOCXU.SpatialFilterConstants.FLT_LINESEG_LTOR );
int nDstLeft   = nTrimLeft;
int nDstTop    = nTrimTop;
int nDstWidth  = nTrimWidth;
int nDstHeight = nTrimHeight;
int nSrcLeft = 0;
int nSrcTop  = 0;
LEAD1.Combine( nDstLeft, nDstTop, nDstWidth, nDstHeight, LEAD2.getBitmap(), nSrcLeft, nSrcTop, LTOCXU.CombineConstants.CB_OP_ADD );

LEAD1.ForceRepaint();
setCursor( Cursor.DEFAULT );  // default