This method draws a rectangle in the designated object (screen, printer, image data).

[Visual Basic]   [ Boolean = ]imagekitcontrolname.PrintDraw.Rectangle(DeviceValue As LONG_PTR, left As Long, top As Long, right As Long, bottom As Long, DeviceMode As OutPutDeviceModeConstants)
[Visual C++]     [ BOOL = ]imagekitcontrolname.GetPrintDraw().Rectangle(LONG_PTR DeviceValue, long left, long top, long right, long bottom, long DeviceMode)
[VB.NET]   [ Boolean = ]imagekitcontrolname.PrintDraw.Rectangle(DeviceValue As Integer(x86) or Long(x64), left As Integer, top As Integer, right As Integer, bottom As Integer, DeviceMode As ImageKit10(A)Lib.OutPutDeviceModeConstants)
[C#.NET]   [ bool = ]imagekitcontrolname.PrintDraw.Rectangle(int(x86) or long(x64) DeviceValue, int left, int top, int right, int bottom, ImageKit10(A)Lib.OutPutDeviceModeConstants DeviceMode)

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

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.

Differences between ImageKit7/8

The DeviceValue argument's type has changed.

 

The ImageKit10 ActiveX is a product created by Newtone Corporation