DataMatrix BarCode ActiveX Methods |
||||||||||||||
AboutBox Method
Opens an About window. Syntax Return Valueobject.AboutBox() No return value. |
||||||||||||||
ShowProperties Method
Opens a custom properties of the DataMatrix Barcode ActiveX Control. Syntax Return Valueobject.ShowProperties() No return value. |
||||||||||||||
SaveToImageFile Method
Saves the image of the barcode to a file. Syntax Parametersobject.SaveToImageFile(cx, cy, sFileName, [lRes,] [dm]) Return Value No return value.Remarks The format the file will be saved in depends on the extension of the file name For example, if you specify sFileName as "img1.jpg", the barcode will be saved as JPEG.Examples '1. |
||||||||||||||
PartialWritePicture Method
Saves the barcode to an existing image file. The barcode can occupy just the part of the image file it needs. Syntax Parametersobject.PartialWritePicture(sFileName, x, y, width, height) Return Value No return value.Remarks The image file defined by the sFileName parameter can be of the following formats: "bmp", "jpg", "jpeg", "gif", "tiff" and "png".Examples Call DataMatrix.PartialWritePicture("c:\1.jpg", 10, 10, 60, 60) You can use this method to add a barcode to any of your image files. This barcode can be used to identify the file or serve other purposes. |
||||||||||||||
CopyToClipboard Method
Copies the image of the barcode onto the clipboard. After that you can insert this image into your program using Ctrl+V or the Paste menu item. Syntax Parametersobject.CopyToClipboard(cx, cy) Return Value No return value. |
||||||||||||||
DrawMatrixToSize Method
Draws the barcode in the device context. You can use either printer or screen as the device context. Syntax object.DrawMatrixToSize(X, Y, CX, CY, dm, [hDC]) Parameters
Return Value No return value.Examples 'Draw a matrix to a screen. |
||||||||||||||
BeginPrint Method
Opens access to a printer. Syntax Parametersobject.BeginPrint(sPrinterName) Return Value No return value.Remarks This function must be called first before other printing features are used. |
||||||||||||||
EndPrint Method
Closes the printer. You cannot use any printing features after that. Syntax Return Valueobject.EndPrint() No return value. |
||||||||||||||
NewPage Method
The StartPage function prepares the printer driver to accept data. Syntax Return Valueobject.NewPage() No return value. |
||||||||||||||
EndPage Method
The EndPage function notifies the device that the application has finished writing to a page. This function is typically used to direct the device driver to advance to a new page. Syntax Return Valueobject.EndPage() No return value. |
||||||||||||||
GetPrinterHDC Method
The function returns the handle of the printer previously opened with the help of the BeginPrint function. Syntax object.GetPrinterHDC() Return Value HDC |
||||||||||||||
SetPrinterHDC Method
Defines the handle of the printer that will be used for printing. If this function is called, you do not have to call BeginPrint. In this case the entire process of closing/opening the printer, etc. will be controlled outside the DataMatrix ActiveX Control. Syntax Parametersobject.SetPrinterHDC(hDC) Return Value No return value.Example Printer.CurrentX = 2048 |
||||||||||||||
BinaryWritePicture Method
This method is similar to SaveToImageFile, but instead of saving the image to a file it represents it as a byte array. Syntax object.BinaryWritePicture(sFmt, CX, CY) Parameters
Return Value Variant that specifies safe array of the bytes.Remarks This method can be useful for sending the image over the Internet. For example, it can be used by the IIS server.Example There is a short example of the ASP page distributed together with DataMatrix ActiveX Control.<% ' datamatrix.asp ' (c) 1999-2005 www.BarcodeTools.com ' we are sending a GIF image to the client Response.ContentType = "image/gif" Response.BinaryWrite Barcode.BinaryWritePicture("gif", 200, 200) SET Barcode=nothing %> |
||||||||||||||
GetMatrixSize Method
This method calculates the matrix size needed to get the module of the necessary size. Module is a single cell in a matrix symbology used to encode one bit of data. Syntax Parametersobject.GetMatrixSize(module, xRes, yRes, dmIn, dmOut, width, height) Examples Print DataMatrix with the module size of 40 Mils. The matrix must begin with X=10 mm, Y=10 mm 'open a current printer
'if dmIn and dmOut are specified in pixels, you do not have to specify the resolution (xRes, yRes), but it must not be equal to 0. |
||||||||||||||
GetMatrixWidth Method
This method calculates only matrix width needed to get the module of the necessary size. Syntax Parametersobject.GetMatrixWidth(module, xRes, yRes, dmIn, dmOut) Return value DataMatrix widthSee also GetMatrixSize |
||||||||||||||
GetMatrixHeight Method
This method calculates only matrix height needed to get the module of the necessary size. Syntax Parametersobject.GetMatrixHeight(module, xRes, yRes, dmIn, dmOut) Return value DataMatrix heightSee also GetMatrixSize |
||||||||||||||
FreezeEncode Method
This method pauses or resumes encoding the matrix. It makes sense to use this method in heavily loaded application, for example, web services, etc. Syntax Parametersobject.FreezeEncode(bFreeze) Return Value No return value.Example You need to set several properties of the DataMatrix control. Each time some properties are set (PreferredFormat, DataToEncode, EncodingMode and others) the matrix is re-encoded, i.e. the Reed-Solomon codes are calculated, the matrix is build, etc. It takes a lot of CPU time. To improve the performance of the application, you can pause encoding and resume it only after all properties are set. DataMatrixCtrl1.FreezeEncode (True) |