Barcodes in Excel

Barcodes in Word

Barcodes in Access

More Tutorials

User Manual

Description

Returns the image of the component (this is a read-only property, not available at design-time). You may use this property to output a bar code to printer.

Syntax

BarCodeWiz1.Picture

Examples

VB 6 Example : Send a bar code image to your printer. It will print the bar code in the top left position on the page (0,0).


Printer.PaintPicture BarCodeWiz1.Picture, 0, 0
Printer.EndDoc                

Visual C++ Example: Retrieve the Picture property


CWiz m_Wiz;      
CPicture pic = m_Wiz.GetPicture();   

Visual C++ Example: Send a bar code image to your printer


CPrintDialog printdlog(FALSE);      
printdlog.GetDefaults();

CDC dc;
dc.Attach(printdlog.GetPrinterDC()); 

DOCINFO docinfo;
memset(&docinfo,0,sizeof(docinfo));
docinfo.cbSize = sizeof(DOCINFO);
docinfo.lpszDocName = "barcodewiz";       // document name for the spooler

if (dc.StartDoc(&docinfo) > 0)
{
      dc.StartPage();
      // Map Mode must be set after each StartPage().
      // Working with HiMetric units (1/100 of a mm)
      dc.SetMapMode(MM_HIMETRIC);

      CPicture pic = m_WizMain.GetPicture();

      long imageHeight = pic.GetHeight();
      long imageWidth = pic.GetWidth();

      // Remember that the vertical coordinates are reversed in MM_HIMETRIC
      CRect rct( 200, -200, 200 + imageWidth, - 200 - imageHeight );

      dc.PlayMetaFile((HENHMETAFILE)pic.GetHandle(), rct);
      dc.EndPage();
      dc.EndDoc(); // Start printing
}

dc.DeleteDC();