Methods of using the barcode image

To paint the control's Picture on the form use the PaintPicture method, or draw your own bars using the Printers Line method. Using the PaintPicture method the code will look like this:

If AbcDl71.ErrorCode = 0 Then
    Form1.PaintPicture AbcDl71.Picture,
20, 20, i, j

where the (20,20) specifies the coordinates on the form of the top left-hand corner of the barcode image, and i and j represent the required width and height of the image respectively.

The control's  Picture may be passed to the clipboard using

I = AbcDl71.CopyImage()

The Visual Basic Picture object contains a metafile image of the generated barcode. In the event of an error in barcode image generation the image is empty, and the ErrorCode property is set to a non-zero value.

The control's Picture may be printed using the PaintPicture method of the Printer object, eg.

Printer.ScaleMode = 6  ' sets printer scale to mm

Printer.PaintPicture AbcDl71.Picture, 20, 20,  AbcDl71. PictureWidth,      AbcDl71. PictureHeight

Printer.NewPage

Printer.EndDoc

Where the (20,20) refers to the top, left coordinates of the barcode image on the printer's page.

Note that the PrintForm method may also be used, although on some systems this may show images of unsuitable resolution.

For printing under VB.NET or from C# see the example in Creating a barcode Picture under Using Active Barcode Control in VB or .NET.

The image created by the Active Barcode Control may also be saved in a file in a graphics format using the SaveImage(filename) method. The image type must be specified by using the permitted filename extensions - .wmf, .bmp, .eps, .pcx, png .or .gif.

 

 

More:

Active Barcode Control Properties