Picture
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
Visual Basic Examples
Example 1. 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
Example 2. Set the Picture property of a PictureBox (named Picture1) to that of BarCodeWiz1.
Picture1.Picture = BarCodeWiz1.Picture
Visual C++ Examples
Example 1. Retrieve the Picture property.
CWiz m_Wiz; CPicture pic = m_Wiz.GetPicture();
Example 2. 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(); |
