Printer.computeTrim

Given a <em>client area</em> (as described by the arguments), returns a rectangle, relative to the client area's coordinates, that is the client area expanded by the printer's trim (or minimum margins). <p> Most printers have a minimum margin on each edge of the paper where the printer device is unable to print. This margin is known as the "trim." This method can be used to calculate the printer's minimum margins by passing in a client area of 0, 0, 0, 0 and then using the resulting x and y coordinates (which will be <= 0) to determine the minimum margins for the top and left edges of the paper, and the resulting width and height (offset by the resulting x and y) to determine the minimum margins for the bottom and right edges of the paper, as follows: <ul> <li>The left trim width is -x pixels</li> <li>The top trim height is -y pixels</li> <li>The right trim width is (x + width) pixels</li> <li>The bottom trim height is (y + height) pixels</li> </ul> </p>

@param x the x coordinate of the client area @param y the y coordinate of the client area @param width the width of the client area @param height the height of the client area @return a rectangle, relative to the client area's coordinates, that is the client area expanded by the printer's trim (or minimum margins)

@exception SWTException <ul> <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li> </ul>

@see #getBounds @see #getClientArea

class Printer
computeTrim
(
int x
,
int y
,
int width
,
int height
)

Meta