This function displays the image in the device context. (the screen or the printer).

[C++Builder/Visual C++]     BOOL IKImageOut(HDC hDC, HANDLE Handle, LPRECT PrintRect, BOOL Aspect, BOOL DXFBlack, BYTE DeviceMode);
[Delphi]         function IKImageOut(hDC: HDC; Handle: THandle; var PrintRect: TRect; Aspect, DXFBlack: LongBool; DeviceMode: Byte): LongBool;
[Visual Basic]   Function IKImageOut(ByVal hDC As Long, ByVal Handle As Long, PrintRect As IKRECT, ByVal Aspect As Long, ByVal DXFBlack As Long, ByVal DeviceMode As Byte) As Long

Parameters

Name Explanation
hDC The device context (The screen or the printer)
Handle The image handle of the raster or vector image
PrintRect A structure containing the coordinates specifying the display area
Aspect Maintains the height to width ratio [True (nonzero): Ratio maintained, False (0): Ratio not maintained]
DXFBlack In DXF images only, this sets black to white and white to black. [True (nonzero): Black and white are exchanged, False (0): Black and white are not exchanged]
DeviceMode The designated object where the image is displayed(0: Screen, 1: Printer)

Return Value

Returns True (nonzero) if successful. Returns False (0) if unsuccessful. Returns False (0) if the cancel button is clicked in the "Print" dialog box.)

Explanation

The IKGetImageOut function displays the image in the device context (the screen or the printer). The PrintRect member variables determine the location of the rectangle in which the image is displayed. If the image does not fit within the specified rectangle, it will be scaled to fit. If the Aspect parameter is False, the image will be stretched to fill the specified rectangle, i.e. the height to width ratio will not be maintained. If the Aspect parameter is True, the image will be displayed within the specified rectangle with the height to width ratio maintained.

This function can draw in the following designated objects: screen or printer.

If the DeviceMode parameter is 0 (the designated object is the screen) then the PrintRect member variables are in pixel units.

If the DeviceMode parameter is 1 (the designated object is the printer) then the PrintRect member variables are in 0.1mm units.


Sample Code in Visual Basic:

   Dim Ret As Long

   Dim Rect1 As IKRECT

   Dim Rect2 As IKRECT

   Dim Width As Long

   Dim Height As Long

   'retrieving the paper size and specified printing area

   Ret = IKGetPaperSize(hDC, Rect1, Width, Height, 1)

   Rect2.Left = 0

   Rect2.Top = 0

   Rect2.Right = Rect1.Right - Rect1.Left

   Rect2.Bottom = Rect1.Bottom - Rect1.Top

   Ret = IKImageOut(hDC, ImgHandle, Rect2, False, True, 1)

 

[The differences from the ImageKit5]

Function Name Parameters
IK5ImageOut: hDC, Handle, PrintRect, Aspect
IKImageOut: hDC, Handle, PrintRect, Aspect, DXFBlack, DeviceMode

If you set the DXFBlack parameter to False and then set the DeviceMode parameter to the value that you used in the ImageKit5 IKSetDeviceMode, then there is no difference between this function in the ImageKit6 and the ImageKit5.

 

The ImageKit10 ActiveX is a product created by Newtone Corporation