FloaterDstClip... example for Visual J++

The following code adjusts the destination clipping rectangle of the floater. You can test it by adding it to a new command button for the lesson described in Outlining, Dragging, and Pasting a Region. By default, the destination clipping rectangle for the floater is the full client area. This code gets the current values and uses them to reduce the size of the clipping rectangle.

// Set variables to use for adjustment increments.
int nAdjustX = (int) LEAD1.getScaleWidth() / 20;
int nAdjustY = (int) LEAD1.getScaleHeight() / 20;

// Determine new values, based on adjustments of current values. 
int nNewLeft   = (int) LEAD1.getFloaterDstClipLeft() + nAdjustX;
int nNewTop    = (int) LEAD1.getFloaterDstClipTop() + nAdjustY;
int nNewWidth  = (int) LEAD1.getFloaterDstClipWidth() - ( 2 * nNewLeft );
int nNewHeight = (int) LEAD1.getFloaterDstClipHeight() - ( 2 * nNewTop );

// Set the clipping rectangle to the new values.
LEAD1.SetFloaterDstClipRect( nNewLeft, nNewTop, nNewWidth, nNewHeight );