This method retrieves the number of elements in the array that will be returned when a supported item is retrieved from the printer specified by the printer name.

[Visual Basic]   [ Long = ]imagekitcontrolname.PrintDraw.GetArrayNum(CapNo As PrinterCapabilityConstants)
[Visual C++]     [ long = ]imagekitcontrolname.GetPrintDraw().GetArrayNum(long CapNo)
[VB.NET]   [ Integer = ]imagekitcontrolname.PrintDraw.GetArrayNum(CapNo As ImageKit10(A)Lib.PrinterCapabilityConstants)
[C#.NET]   [ int = ]imagekitcontrolname.PrintDraw.GetArrayNum(ImageKit10(A)Lib.PrinterCapabilityConstants CapNo)

* ImageKit10Alib refers to the ANSI version, ImageKit10Lib refers to the Unicode version.

Parameters

Name Explanation
CapNo The type of item retrieved (0: Paper size, 1: Paper tray, 2: Resolution)

The following constants can be used: (ikPrinterPaperSize = 0, ikPrinterPaperBin = 1, ikPrinterResolution = 2).

Return Value

Returns the number of retrieved items. Returns 0 if unsuccessful.

Explanation

This method retrieves the number of elements in the array returned whenever a supported item is retrieved from the printed specified by the printer name. The EnumPaperSizes, EnumPaperBins, and EnumResolutions methods pass arrays as parameters and the GetArrayNum method can be used to find out how many elements are contained in those arrays.

 

Sample code:

Visual Basic

    Dim Size As Long

    Dim XResolutions() As Long

    Dim YResolutions() As Long

    Dim Ret As Long

    Size = ImageKit1.PrintDraw.GetArrayNum(2)

    If Size < 1 Then Exit Sub

    ReDim XResolutions(Size)

    ReDim YResolutions(Size)

    Ret = ImageKit1.PrintDraw.EnumResolutions(XResolutions(0), YResolutions(0))

    ' various programming code

        ..............

 

Visual C++

    long Size;

    long *XResolutions;

    long *YResolutions;

    ImageKit1.GetPrintDraw().SetPrinterName("EPSON LP-8200C");

    Size = ImageKit1.GetPrintDraw().GetArrayNum(2);

    if (Size < 1) return;

    XResolutions = (long *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(long) * Size);

    YResolutions = (long *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(long) * Size);

    __try {

        ImageKit1.GetPrintDraw().EnumResolutions(XResolutions, YResolutions);

        //various programming code

        ..............

    } __finally {

        HeapFree(GetProcessHeap(), 0, XResolutions);

        HeapFree(GetProcessHeap(), 0, YResolutions);

    }

 

VB.NET

    Dim Size As Integer

    Dim Ret As Integer

 

    ImageKit1.PrintDraw.PrinterName = "EPSON LP-8200C"

    Size = ImageKit1.PrintDraw.GetArrayNum(2)

    If Size < 1 Then Exit Sub

 

    Dim XResolutions As Integer() = New Integer(Size - 1) {}

    Dim YResolutions As Integer() = New Integer(Size - 1) {}

    Ret = ImageKit1.PrintDraw.EnumResolutions(XResolutions(0), YResolutions(0))

 

    ' various programming code

        ..............

 

C#.NET

    ImageKit1.PrintDraw.PrinterName = "EPSON LP-8200C";

    // When using the ANSI version, ImageKit10ALib.PrinterCapabilityConstants.ikPrinterResolution

    Size = ImageKit1.PrintDraw.GetArrayNum(ImageKit10Lib.PrinterCapabilityConstants.ikPrinterResolution);

    if (Size < 1) return;

 

    int Ret;

    int[] XResolutions = new int[Size];

    int[] YResolutions = new int[Size];

    Ret = ImageKit1.PrintDraw.EnumResolutions(ref XResolutions[0], ref YResolutions[0]);

    // various programming code

        ..............

 

The ImageKit10 ActiveX is a product created by Newtone Corporation