The Ik10Print.dll provides functions for controlling printers and functions for drawing figures and text in the designated object (the screen, printer or image data)

 

      Ik10Print.dll Functions:

Function Name Explanation
IKArc Draws an arc in the designated object (the screen, printer, or image data)
IKChord Draws a chord in the designated object (the screen, printer, or image data)
IKDrawFocusRect Draws a rectangle in the style used to indicate that the rectangle has the focus
IKDrawString Uses GDI+ to draw text on the designated object
IKDrawText Draws text in a rectangle specified in the designated object (the screen, printer, or image data)
IKEllipse Draws an ellipse in the designated object (the screen, printer, or image data)
IKEnumPaperBins Retrieves the paper tray names and tray numbers from the printer designated by the printer name
IKEnumPaperSizes Retrieves the names, size numbers, and dimensions of the paper from the printer designated by the printer name
IKEnumPorts Retrieves a list of ports
IKEnumPrinters Lists the installed printers
IKEnumResolutions Letrieves a list of supported resolutions for the printer designated by the printer name
IKFillRect draws Draws a filled rectangle in the designated object (the screen, printer, or image data)
IKFrameRect Draws the border of the specified rectangle in the designated object
IKPrintGdipEnd Ends the GDI+ process
IKPrintGdipStart Initializes the GDI+ process
IKGetDefaultPrinter Retrieves the default printer
IKGetDevModeHandle Retrieves the handle to the pointer of the specified printer's DEVMODE structure
IKGetDevModeInfo Retrieves printer information from the handle to the DEVMODE structure
IKGetImageFromHdc Retrieves the image from the screen device context
IKGetPaperSize Retrieves the paper size and specified printing area from the printer device context
IKGetPixel Retrieves the RGB values from a specified pixel in the designated object (The screen or the image data)
IKGetPrinterPort Retrieves the printer port
IKGetTextExtent Retrieves the height and width of the text from the text information
IKImageOut Displays the image in the device context. (the screen or the printer)
IKImageOutToHwnd Displays the image in a window usint the window handle
IKLine Draws a line in the designated object (the screen, printer, or image data).
IKMeasureString Uses GDI+ functionality to retrieve the height and width of text from text information
IKPaint Fills an existing color with a different color
IKPie Draws a pie shaped figure in the designated object (the screen, printer, or image data)
IKPolyBezier Draws a bezier curve in the designated object (the screen, printer, or image data)
IKPolygon Draws a polygon in the designated object
IKPolyline Draws a polyline in the designated object.
IKPreviewInit Scales the screen resolution to the resolution of the output printer
IKPrintAbortDoc Terminates the current print job
IKPrintCreateDC Creates a device context
IKPrintDeleteDC Deletes the device context
IKPrintDlg Displays the Print dialog and creates a device context.
IKPrintEndDoc Ends the print job
IKPrintEndPage Ends the printing of a page and goes to the next page
IKPrintGetArrayNum Retrieves the number of elements in the array that will be returned when a supported item is retrieved
IKPrintStartDoc Starts the print job
IKPrintStartPage Starts the printing of a page
IKRectangle Draws a rectangle in the designated object (screen, printer, image data).
IKReleaseDevModeHandle Frees the handle to the DEVMODE structure
IKRoundRect Draws a rounded rectangle in the designated object (screen, printer, image data)
IKSaveDevModeHandle Saves the handle to the DEVMODE structure into the file specified by the PrintFileName parameter
IKSetDefaultPrinter Sets the default printer
IKSetDevModeInfo Updates the contents referred to by the handle of the DEVMODE structure
IKSetPixel Sets a color in the specified pixel in the designated object. (screen, or image data)
IKSetPrint Saves the settings entered in the "Print Setup" dialog
IKTextOut Draws text from a specified point in the designated object.(screen, printer, image data)

 

 

Structure definitions (User-defined types)

IKPRINT_DEVMODEINFO: This structure is used when retrieving and setting printer information

(1)C++Builder
     typedef struct {
          short     Orientation;
          short     PaperSize;
          short     Zoom;
          WORD   Copies;
          short     PaperBin;
          short     XResolution;
          short     YResolution;
          short     ColorMode;
          short     Duplex;
          BYTE     Collate;
          short     CustomPaperWidth;
          short     CustomPaperHeight;
     } IKPRINT_DEVMODEINFO;

In Delphi

     type
          IKPRINT_DEVMODEINFO = Record
               Orientation:  Smallint;
               PaperSize:   Smallint;
               Zoom:         Smallint;
               Copies:        Word;
               PaperBin:     Smallint;
               XResolution: Smallint;
               YResolution: Smallint;
               ColorMode:   Smallint;
               Duplex:        Smallint;
               Collate:        Byte;
               CustomPaperWidth: Smallint;
          CustomPaperHeight: Smallint;
          end;

 

Orientation:
The printing orientation. 1: Vertical or Protrait (DMORIENT_PORTRAIT), 2: Horizontal or Landscape (DMORIENT_LANDSCAPE)
PaperSize:
The paper size
1: Letter, 8.5 x 11 in (DMPAPER_LETTER)
2: Letter Small, 8.5 x 11 in (DMPAPER_LETTERSMALL)
3: Tabloid, 11 x 17 in (DMPAPER_TABLOID)
4: Ledger, 17 x 11 in (DMPAPER_LEDGER)
5: Legal, 8.5 x 14 in (DMPAPER_LEGAL)
6: Statement, 5.5 x 8.5 in (DMPAPER_STATEMENT)
7: Executive, 7.25 x 10.5 in (DMPAPER_EXECUTIVE)
8: A3, 297 x 420 mm (DMPAPER_A3)
9: A4, 210 x 297 mm (DMPAPER_A4)
10: A4 Small, 210 x 297 mm (DMPAPER_A4SMALL)
11: A5, 148 x 210 mm (DMPAPER_A5)
12: B4, 250 x 354 mm (DMPAPER_B4)
13: B5, 182 x 257 mm (DMPAPER_B5)
256: User defined(DMPAPER_USER)
Zoom:
Refers to the scaling magnification (from 0 to 100)
Copies:
The number of copies of printer output (starts from 1)
PaperBin:
The paper tray or bin
1: Use paper from the upper bin (DMBIN_UPPER)
2: Use paper from the lower bin (DMBIN_LOWER)
3: Use paper from the middle bin (DMBIN_MIDDLE)
4: Wait for manual feed (DMBIN_MANUAL)
5: Use envelopes from envelope feeder(DMBIN_ENVELOPE)
6: Use envelopes from envelope feeder but wait for manual feed (DMBIN_ENVMANUAL)
7: Use paper from the current bin (DMBIN_AUTO)
8: Use paper fed from the tractor feeder (DMBIN_TRACTOR)
9: Use paper from the small paper bin (DMBIN_SMALLFMT)
10: Use paper from the large paper bin (DMBIN_LARGEFMT)
11: Use paper from the large capacity feeder (DMBIN_LARGECAPACITY)
14: Use paper from the attached cassette cartridge (DMBIN_CASSETTE)
XResolution:
The printer horizontal resolution *1
Value: The number of dots per inch (DPI)
-1: Draft resolution (DMRES_DRAFT)
-2: Low resolution (DMRES_LOW)
-3: Medium resolution (DMRES_MEDIUM)
-4: High resolution (DMRES_HIGH)
YResolution:
The printer vertical resolution (from 0) *2
ColorMode:
Refers to whether or not a document is printed in color or in monochrome when using a color printer
1: Monochrome (DMCOLOR_MONOCHROME), 2: Color (DMCOLOR_COLOR)
Duplex:
Refers to whether a specific printer prints on one side or both sides of the paper
1: Single sided (DMDUP_SIMPLEX)
2: Double sided - Vertical (DMDUP_VERTICAL) [Also known as portrait]
3: Double sided - Horizontal (DMDUP_HORIZONTAL) [Also known as landscape]
Collate:
Values other than zero sets collating
CustomPaperWidth:
When PaperSize = 256, sets the paper width (0.1mm units) *2
CustomPaperHeight:
When PaperSize = 256, sets the paper height (0.1mm units) *2

( ) The explanation contained in the parentheses has the same meaning as the constants used by WindowsAPI

Regarding PaperSize, it is possible to retrieve or set values greater than 14. For details, please refer to the appropriate WindowsAPI for your development container. Note that the values that may be set are dependent upon the print driver being used. Because of this, the results of some property settings may not be apparent or may be ignored by that particular print driver. For details please refer to the documentation for that printer.

*1 Name has been changed from (PrintQuality to XResolution)
*2 This member has been added to the ImageKit10

This is important when converting programs from the ImageKit6

IKPRINT_DIALOG: This structure is used with the print dialog (IKPrintDlg)

In C++Builder

     typedef struct {
          BYTE     Collate;
          WORD     Copies;
          WORD     FromPage;
          WORD     ToPage;
          WORD     MaxPage;
          WORD     MinPage;
          DWORD    Options;
          BYTE     PrintRange;
          BYTE     PrintToFile;
     } IKPRINT_DIALOG;
     typedef IKPRINT_DIALOG * PTR_IKPRINT_DIALOG;

In Delphi

     type
          IKPRINT_DIALOG = Record
               Collate:     Byte;
               Copies:     Word;
               FromPage:     Word;
               ToPage:     Word;
               MaxPage:     Word;
               MinPage:     Word;
               Options:     DWORD;
               PrintRange:     Byte;
               PrintToFile:     Byte;
          end;

 

Collate:
Refers to whether or not the [Collate] checkbox in the Print dialog is checked. (values other than zero mean checked.)
Copies:
Refers to the number of copies to be printed (from 1)
FromPage:
Refers to the initial value of the page range to be printed (from 1)
ToPage:
Refers to the ending value of the page range to be printed (from 1)
MaxPage:
Refers to the maximum value for the page range to be printed (from 1)
MinPage:
Refers to the minimum value for the page range to be printed (from 1)
Options:
Refers to the initial values for the Print dialog
0x4 Disables the [Selection] radio button (PD_NOSELECTION)
0x8 Disables the [Page Range] radio buttons (PD_NOPAGENUMS)
0x80 Does not display a warning when there is no default printer (PD_NOWARNING)
0x800 Displays the Help button (PD_SHOWHELP)
0x80000 Disables the [Print to File] checkbox (PD_DISABLEPRINTTOFILE)
0x100000 Does not display the [Print to File] checkbox (PD_HIDEPRINTTOFILE)
In Delphi, 0x should be replaced by $.
( ) The explanation contained in the parentheses has the same meaning as the constants used by WindowsAPI
When setting multiple values, please separate them with "|", "or", "Or" .
PrintRange:
Refers to the type of page range used by the Print dialog. (0: All, 1: Selection, 2: Pages)
PrintToFile:
Refers to whether or not the [Print to File] checkbox in the Print dialog is checked. (nonzero: PrintToFile checkbox is checked). When this checkbox is checked, documents are printed to a file instead of to a printer.

 

IKPRINT_DRAWINFO: This stucture is used when drawing diagrams or text

In C++Builder

     typedef struct {
          long     PenWidth;
          BYTE     PenStyle;
          BYTE     PenMode;
          COLORREF     PenColor;
          BYTE     BrushStyle;
          COLORREF     BrushColor;
          BYTE     Transparent;
          COLORREF     BackColor;
     } IKPRINT_DRAWINFO;
     typedef IKPRINT_DRAWINFO * PTR_IKPRINT_DRAWINFO;

In Delphi

     type
          IKPRINT_DRAWINFO = Record
               PenWidth:     Longint;
               PenStyle:     Byte;
               PenMode:     Byte;
               PenColor:     COLORREF;
               BrushStyle:     Byte;
               BrushColor:     COLORREF;
               Transparent:     Byte;
               BackColor:     COLORREF;
          end;

 

PenWidth:
Sets the width of the pen. When drawing to the screen or image data, the units are in pixels. When drawing to the printer, the units are 0.1mm
PenStyle:
Sets the style of the pen. An explanation of the values is given below. The contants in the parentheses are the same as WindowsAPI
0: Pen is invisible. (PS_NULL)
1: Pen is solid. (PS_SOLID)
2: Pen is dashed. (PS_DASH)
3: Pen is dotted. (PS_DOT)
4: Pen has alternating dashes and dots. (PS_DASHDOT)
5: Pen has alternating dashes and double dots. (PS_DASHDOTDOT)
6: Pen is solid.* (PS_INSIDEFRAME)

Note: When drawing figures with functions other than the IKLine and IKRectangle functions, if PenStyle is set from 2 to 5 then PenWidth must be 1. If PenWidth is more than one, a solid pen, (PS_SOLID), will be used.
PenMode:
Sets how the color of the pen interacts with the color on the canvas. The constants in the parentheses are the same as WindowsAPI.

1: Black (R2_BLACK)
2: The inverse of the combination of the pen color and the display color (R2_NOTMERGEPEN)
3: The combination of colors common to both canvas color and the inverse of the pen color. (R2_MASKNOTPEN)
4: The inverse of the color of the pen.(R2_NOTCOPYPEN)
5: The combination of colors common to both pen color and the inverse of the canvas color. (R2_MASKPENNOT)
6: The inverse of the color of the canvas. (R2_NOT)
7: The combination of colors in either pen or canvas, but not both. (R2_XORPEN)
8: The inverse of the combination of colors common to both pen and canvas. (R2_NOTMASKPEN)
9: The combination of colors common to both pen and canvas. (R2_MASKPEN)
10: The inverse of the combination of colors in either pen or canvas but not both. (R2_NOTXORPEN)
11: No change. (R2_NOP)
12: The combination of canvas color and the inverse of the pen color. (R2_MERGENOTPEN)
13: The pen color specified in the PenColor property. (R2_COPYPEN) Default value.
14: The combination of pen color and the inverse of the canvas color. (R2_MERGEPENNOT)
15: The combination of pen color and canvas color. (R2_MERGEPEN)
16: White (R2_WHITE)
PenColor:
Sets the color of the pen. To set the PenColor please use RGB(Red,Green,Blue) format. (If the device cannot produce the color specified, the nearest color will be used.)
BrushStyle:
Sets the pattern of the brush. The constants in the parentheses are the same as WindowsAPI.

0: The brush does not paint. (BS_NULL)
1: The brush paints solid colors. (BS_SOLID)
2: The brush paints a pattern of diagonal lines from the top right to the bottom left. (BS_HATCHED?HS_BDIAGONAL)
3: The brush paints a hatch pattern of vertical and horizontal lines. (BS_HATCHED?HS_CROSS)
4: The brush paints a hatch pattern of crossing diagonal lines. (BS_HATCHED?HS_DIAGCROSS)
5: The brush paints a pattern of diagonal lines from the top left to the bottom right. (BS_HATCHED?HS_FDIAGONAL)
6: The brush paints a pattern of horizontal lines. (BS_HATCHED?HS_HORIZONTAL)
7: The brush paints a pattern of vertical lines. (BS_HATCHED?HS_VERTICAL)
BrushColor
Sets the color of the brush. To set the BrushColor please use RGB(Red,Green,Blue) format. (If the device cannot produce the color specified, the nearest color will be used.)
Transparent:
Sets the transparency of the text background, the background of the hatch brush, or the background between drawn lines. To enable transparency set this to values other than zero.
BackColor: *1
Sets the background color or the color between lines when the pen is set to something other than solid or the brush is set to Hatch Pattern. To set the BackColor please use RGB(Red,Green,Blue) format. (If the device cannot produce the color specified, the nearest color will be used.)

*1 This member has been added to the ImageKit10

This is important when converting programs from the ImageKit5 or from the ImageKit6

IKPRINT_TEXTINFO: used when drawing text

In C++Builder

     typedef struct {
          short     CharSet;
          TCHAR     FontName[LF_FACESIZE];
          WORD     FontSize;
          BYTE     FontBold;
          BYTE     FontItalic;
          BYTE     FontUnderline;
          BYTE     FontStrikeOut;
          BYTE     Transparent;
          BYTE     Direction;
          short     CharAngle;
          long     CharExtra;
          BYTE     HCentering;
          BYTE     VCentering;
          BYTE     RotateString;
          COLORREF     TextColor1;
          COLORREF     TextColor2;
          BYTE     Alpha1;
          BYTE     Alpha2;
          WORD     HotkeyPrefix;
     } IKPRINT_TEXTINFO;
     typedef IKPRINT_TEXTINFO * PTR_IKPRINT_TEXTINFO;

In Delphi

     type
          IKPRINT_TEXTINFO = Record
               CharSet:     Smallint;
               FontName:     array [0..LF_FACESIZE - 1] of Char;
               FontSize:     Word;
               FontBold:     Byte;
               FontItalic:     Byte;
               FontUnderline:     Byte;
               FontStrikeOut:     Byte;
               Transparent:     Byte;
               Direction:     Byte;
               CharAngle:     Smallint;
               CharExtra:     Longint;
               HCentering:     Byte;
               VCentering:     Byte;
               RotateString:     Byte;
               TextColor1:     COLORREF;
               TextColor2:     COLORREF;
               Alpha1:     Byte;
               Alpha2:     Byte;
               HotkeyPrefix:     Word;
          end;

 

CharSet:
Sets the character set for the fonts. Values range from -1 to 255. Values other than -1 correspond to the same character set values used by Windows.

-1: ANSI or JIS character sets [This value is for backwards compatibility with the ImageKit5]
0: ANSI character set (ANSI_CHARSET)
1: Character set is selected using the FontName and FontSize (DEFAULT_CHARSET)
2: Symbol character set (SYMBOL_CHARSET)
128: Japanese shift JIS character set (SHIFTJIS_CHARSET)
255: Operating system character set (OEM_CHARSET)
The constants in the parentheses are the same as WindowsAPI
FontName:
Sets the font name used when drawing text. (For example: "Arial").
FontSize:
Sets the font size in points for drawing text.
FontBold:
Sets whether or not the font is bold. (To enable, set to values other than zero)
FontItalic:
Sets whether or not the font is italics. (To enable, set to values other than zero)
FontUnderline:
Sets whether or not the font is underlined. (To enable, set to values other than zero. However, depending on the values of CharAngle and Direction, FontUnderline may be disabled.)
FontStrikeOut:
Sets whether or not the font has a strike-through line. (To enable, set to values other than zero. However, depending on the values of CharAngle and Direction, FontStrikeOut may be disabled.)
Transparent:
Sets the transparency of the text background, the background of the hatch brush, or the background between drawn lines. (Set to nonzero to enable. If the Transparent is set to nonzero, then TextBackColor color becomes transparent.
Direction:
Sets the drawing direction of the text line. (Enabled when RotateString is False.) 0: From left to right (writing horizontally), 1: From right to left (writing horizontally), 2: From top to bottom (writing vertically), 3: From bottom to top (writing vertically)
CharAngle:
Sets the angle of rotation for text drawn using the IKDrawText,IKTextOut, or IKDrawString functions. (Rotation is in degree units from 0 to 360 degrees. IKDrawText and IKTextOut rotation is counterclockwise, IKDrawString rotation is clockwise.)
CharExtra:
Sets the space between characters. (For default spacing set this to 0). If the text is drawn on the screen or the image data, set the value in pixel units. If the text is drawn on the printer, then set the values in 0.1mm units.
HCentering:
Sets the horizontal position of the text. (Used by IKDrawString, IKDrawText, and IKMeasureString)
0:Left, 1:Center, 2:Right
VCentering:
Sets the vertical position of the text. (Used by IKDrawString, IKDrawText, and IKMeasureString)
0:Top, 1:Center, 2:Bottom
RotateString:
Sets whether each character in the text set in Text is rotated, or the whole line of text is rotated. (used with IKGetTextExtent and IKTextOut)
0: Each character in the text is rotated (CharAngle is enabled for 0, 90, 180, and 270 degrees only), Nonzero: The whole line of text is rotated
TextColor1:*1
Sets the color of the text drawn by IkDrawText and IKTextOut. With IKDrawString, depending on the type of brush the meaning of this member is different

Solid Brush: Sets the brush color
Hatch Brush: Sets the color for drawn lines
Gradiation Brush: Sets the start color for line gradiation
*Texture Brush: Disabled
To set the TextColor1 please use RGB(Red,Green,Blue) format. (If the device cannot produce the color specified, the nearest color will be used.)
TextColor2:*1
Sets the background color of the text drawn by IkDrawText and IKTextOut. With IKDrawString, depending on the type of brush the meaning of this member is different

Hatch Brush: Sets the color drawn between lines
Gradiation Brush: Sets the end color for line gradiation
*Solid and Texture Brush: Disabled
To set the TextColor2 please use RGB(Red,Green,Blue) format. (If the device cannot produce the color specified, the nearest color will be used.)
Alpha1:*2
This is the alpha value for TextColor1. If 255, then it is completely transparent. (Used by IKDrawString)
Alpha2: *2
This is the alpha value for TextColor2. If 255, then it is completely transparent. (Used by IKDrawString)
HotkeyPrefix: *2
Sets how "hotkey" prefixed strings are handled

For IKDrawText    0: The hotkey prefix is displayed as a normal string (i.e. "&File"), 1: The hotkey prefix is displayed as a hotkey (i.e. "File")
For IKDrawString    0: The hotkey prefix is displayed as a normal string (i.e. "&File"), 1: The hotkey prefix is displayed as a hotkey (i.e. "File"), 2: The hotkey prefix is not displayed.

*1 Names have been changed from TextForeColor to TextColor1 and from TextBackColor to TextColor2

*2 This member has been added to the ImageKit7

This is important when converting programs from the ImageKit5 or from the ImageKit6

The ImageKit10 VCL is a product created by Newtone Corporation