GetCropArea

#include “BlackIceDEVMODE.h”

 

BOOL GetCropArea(BlackIceDEVMODE* pDevMode, DWORD* dwCropLeft, DWORD* dwCropRight, DWORD* dwCropTop, DWORD* dwCropBottom);

 

Description

 

Returns the area that is cut off when cropping is enabled. Use the GetCropMode function to see how the cut off area is specified and call GetCropArea to retrieve the values. If GetCropMode returns 0, the return values of GetCropArea are the width of each margin that will be cut off.

If GetCropMode returns 1, the return values of GetCropArea 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.

 

 

Parameters

 

BlackIceDEVMODE* pDevMode    

– pointer to the BlackIceDEVMODE structure

DWORD* dwCropLeft

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

DWORD* dwCropRight

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

DWORD* dwCropTop

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

DWORD* dwCropBottom 

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

 

Return value

 

TRUE on success otherwise FALSE.

 

Programming Notes

 

None

 

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);