#include “BlackIceDEVMODE.h”
BOOL SetCropArea(BlackIceDEVMODE* pDevMode, DWORD dwCropLeft, DWORD dwCropRight, DWORD dwCropTop, DWORD dwCropBottom);
Description
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.
Parameters
BlackIceDEVMODE* pDevMode |
– pointer to the BlackIceDEVMODE structure |
|
|
DWORD dwCropLeft |
– The width of the left margin to cut off, or coordinates of a rectangle in hundredths of inches that will be kept. |
DWORD dwCropRight |
– The width of the right margin to cut off, or coordinates of a rectangle in hundredths of inches that will be kept. |
DWORD dwCropTop |
– The height of the top margin to cut off, or coordinates of a rectangle in hundredths of inches that will be kept. |
DWORD 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.
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);