Home|Download|Buy online|Affiliates|Search|Feedback|Site Map|ReviewsUse our online RSS & XML news feeds to get the latest news about our products delivered to your desktop... RSS feed    04.02.2012
Home»EAN128 barcode»SDK
Find out more how to use BestView...
A sample of use

A sample of use

Below is the part of the WM_PAINT (OnDraw) event handler:

		
	#include "ean128.h"
	
	void OnDraw(HDC dc)
	    {
	    // ========================================= 
	    // =         Start barcode drawing         = 
	    // ========================================= 
	    
	    // The instance of the class 
	    EAN_128::EAN128 Ean128;
	    // The horizontal resolution
	    // of the output device
	    int xres=::GetDeviceCaps(dc,LOGPIXELSX); 
	    // The vertical resolution
	    // of the output device
	    int yres=::GetDeviceCaps(dc,LOGPIXELSY);
	    // An initialization of the instance of the class
	    Ean128.SetXResolution(xres);  
	    Ean128.SetYResolution(yres);
	    
	    // Let us set the one module width =
	    // 0.25 millimeters - seems to be optimal for most
	    // applications
	    Ean128.SetOneModuleWidth(0.25);
	    
	    // Reset the internal list of pieces  
	    Ean128.Reset();

	    // Let our barcode consist of two pieces:
	    // "1234567890" digit string 
	    // and 
	    // "abcdef" character string
	    Ean128.AddPiece(_T("1234567890"));
	    Ean128.AddPiece(_T("abcdef"));
	    
	    // Now we are ready to draw the barcode
	    // Draw the barcode!
	    Ean128.Draw(dc,100,200,50,RGB(0,0,255)); 
	    // That is all! 
	    
	    // ========================================= 
	    // =          End barcode drawing          = 
	    // ========================================= 
	    }
		
Valid HTML 4.01 Transitional© PVL team, 2004-2012, all rights reserved. This Web site and its entire contents are for personal use only and may not be copied, reproduced, modified, published or distributed in any way,without PVL team's prior written permission.