This function retrieves a list of supported resolutions for the printer designated by the printer name.
Parameters
Name | Explanation |
---|---|
PrinterName | The printer name |
Resolutions |
An array containing the list of retrieved resolutions Setting NULL (in C++Builder), nil (in Delphi), the number of elements required in the array will be returned. (1)In C++Builder, pass the pointer to the first element of the array (2)In Delphi, for example, Res: array [0..2] of Word then set Res[0] |
Return Value
Returns the number of retrieved items. Returns 0 if unsuccessful.
Explanation
The IKEnumResolutions function retrieves a list of supported resolutions for the printer designated by the printer name. By setting NULL (in C++Builder) or nil (in Delphi), the required number or elements for the array will be returned. If you need to know the number of elements in the array, the IKPrintGetArrayNum function can be used to retrieve this. The Resolutions parameter contains the retrieved (horizontal and vertical) resolution values in units of dots per inch (dpi)
Sample code:
In C++Builder
int Size;
LPPOINT Resolutions;
Size = IKEnumResolutions("EPSON LP-8200C",
NULL);
if (Size < 1) return;
Resolutions =
(LPPOINT)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
sizeof(POINT) * Size);
__try {
IKEnumResolutions("EPSON
LP-8200C", Resolutions);
// various programming
code
...........
...........
} __finally {
HeapFree(GetProcessHeap(), 0, Resolutions);
}
In Delphi
Size: Integer;
Resolutions: array of TPoint;
Size := IKEnumResolutions('EPSON LP-8200C',
PPoint(nil)^);
if Size < 1 then Exit;
SetLength(Resolutions, Size);
IKEnumResolutions('EPSON LP-8200C',
Resolutions[0]);
// various programming
code
...........
...........