Reference Guide
GdPicture14 Namespace / GdPictureImaging Class / PatchCodeReaderDoScan Method
A unique image identifier of the GdPicture image representing the image in use.
Example





In This Topic
    PatchCodeReaderDoScan Method (GdPictureImaging)
    In This Topic
    Starts a Patch Code recognition process on a specified GdPicture image or on an area of a specified GdPicture image defined by the SetROI method.
    Syntax
    'Declaration
     
    
    Public Function PatchCodeReaderDoScan( _
       ByVal ImageID As Integer _
    ) As GdPictureStatus
    public GdPictureStatus PatchCodeReaderDoScan( 
       int ImageID
    )
    public function PatchCodeReaderDoScan( 
        ImageID: Integer
    ): GdPictureStatus; 
    public function PatchCodeReaderDoScan( 
       ImageID : int
    ) : GdPictureStatus;
    public: GdPictureStatus PatchCodeReaderDoScan( 
       int ImageID
    ) 
    public:
    GdPictureStatus PatchCodeReaderDoScan( 
       int ImageID
    ) 

    Parameters

    ImageID
    A unique image identifier of the GdPicture image representing the image in use.

    Return Value

    A member of the GdPictureStatus enumeration. If the method has been successfully followed, then the return value is GdPictureStatus.OK. We strongly recommend always checking this status first.
    Remarks
    For more details, please refer to our Barcode Recognition Sample included in the installation folder that demonstrates the usage of this method.
    Example
    Finding patchcodes in an image and writing complete barcodes info into a file.
    using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
    {
        int imageID = gdpictureImaging.CreateGdPictureImageFromFile("image.jpg", false);
     
        // Start the patchcodes scanning process and write complete infos into a text file.
        gdpictureImaging.PatchCodeReaderDoScan(imageID);
     
        using (System.IO.StreamWriter file = new System.IO.StreamWriter("pathcodes.txt"))
        {
            int pathcodesFound = gdpictureImaging.PatchCodeReaderGetCodeCount();
     
            for (int i = 1; i <= pathcodesFound; i++)
            {
                // Patchcodes type, possible values are 1, 2, 4, 8, 16 or 32.
                PatchCodeType type = gdpictureImaging.PatchCodeReaderGetCodeType(i);
                file.WriteLine("Patchcode type = " + type.ToString());
     
                // The pathcode position, given by the coordinates of the corners.
                file.WriteLine("Position =  Top-Left=["
                    + gdpictureImaging.PatchCodeReaderGetCodeX1(i) + ", " + gdpictureImaging.PatchCodeReaderGetCodeY1(i)
                    + "] Top-Right=[" + gdpictureImaging.PatchCodeReaderGetCodeX2(i) + ", " + gdpictureImaging.PatchCodeReaderGetCodeY2(i)
                    + "] Bottom-Right=[" + gdpictureImaging.PatchCodeReaderGetCodeX3(i) + ", " + gdpictureImaging.PatchCodeReaderGetCodeY3(i)
                    + "] Bottom-Left=[" + gdpictureImaging.PatchCodeReaderGetCodeX3(i) + ", " + gdpictureImaging.PatchCodeReaderGetCodeY4(i) + "]");
            }
        }
     
        // Release used resources.
        gdpictureImaging.PatchCodeReaderClear();
        gdpictureImaging.ReleaseGdPictureImage(imageID);
    }
    See Also