This method draws a rectangle in the designated object (screen, printer, image data).
Parameters
Name | Explanation |
---|---|
DeviceValue | The device context or the raster image data (i.e. Hdc or ImageHandle) depending on the DeviceMode |
left,top | The x and y coordinates for the top left corner of the rectangle |
right,bottom | The x and y coordinates for the bottom right corner of the rectangle |
DeviceMode | If 0 (ikScreen), then the Rectangle will be drawn in pixel units. If 1 (ikPrinter), the Rectangle will be drawn in 0.1mm units. If 2 (ikMemoryHandle), the Rectangle will be drawn (in pixel units) to the image data according to the DeviceValue parameter |
In Visual Basic the following constants can be used: (ikScreen = 0, ikPrinter = 1, ikMemoryHandle = 2).
Return Value
Returns True (nonzero) if successful. Returns False (0) if unsuccessful.
Explanation
The Rectangle method draws a rectangle in the designated object (screen, printer, image data). The left, top, right, and bottom parameters define the coordinates specifying the rectangle. The outline of the rectangle is drawn from the value set in the PenStyle property and the rectangle is filled by the value set in the BrushStyle property. When drawing a rectangle, it is recommended that the PenWidth, PenMode, PenColor, BrushColor, Transparent, and BackColor properties also be set. The BackColor property is enabled when the Transparent property is False and the pen is solid or the brush is hatch pattern.
If the DeviceMode parameter is 0 or2 then left, top, right, bottom parameters are in pixel units.
If the DeviceMode parameter is 1 then left, top, right, bottom parameters are in 0.1mm units.