SetCropArea

 

Sets the area that is cut off when cropping is enabled. Use the SetCropMode function to set how you want to specify the area and call SetCropArea to set the values. If SetCropMode was called with 0, the parameters of SetCropArea are the width of each margin that will be cut off.

If SetCropMode was called with 1, the parameters of SetCropArea specify a rectangle relative to the top left corner of the page that will be kept. Everything outside the rectangle will be cut off.

The values are specified in hundredths of inches.

 

SetCropArea(pDevMode As Long, dwCropLeft As Long, dwCropRight As Long, dwCropTop As Long, dwCropBottom As Long) As Boolean

 

 

Input value pDevMode

- Handle to the BlackIceDEVMODE structure

Input value dwCropLeft

-The width of the left margin to cut off, or coordinates of a rectangle in hundredths of inches that will be kept.

Input value dwCropRight

-The width of the right margin to cut off, or coordinates of a rectangle in hundredths of inches that will be kept.

Input value dwCropTop

-The height of the top margin to cut off, or coordinates of a rectangle in hundredths of inches that will be kept.

Input value dwCropBottom

-The height of the bottom margin to cut off, or coordinates of a rectangle in hundredths of inches that will be kept.

Return value

- TRUE on success otherwise FALSE.

 

NOTE: For 32-bit applications, use pDevMode as Integer, instead of Long.

 

Code Example

 

To cut off 1 inch off of each side of the page:

 

SetCropEnabled(pDevMode, TRUE);

SetCropMode(pDevMode, 0);

SetCropArea(pDevMode, 100, 100, 100, 100);

 

To cut off everything outside a 10-inch by 10-inch square that begins at 1 inch from the top of the page and 1 inch from the left side:

 

SetCropEnabled(pDevMode, TRUE);

SetCropMode(pDevMode, 1);

SetCropArea(pDevMode, 100, 1100, 100, 1100);