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    17.05.2012
Home»Code128 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 "code128.h"
	
	void OnDraw(HDC dc)
	    {
	    // ========================================= 
	    // =         Start barcode drawing         = 
	    // ========================================= 
	    // The instance of the class 
	    CODE_128::CODE128 Code128;
	    // 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
	    Code128.SetXResolution(xres);  
	    Code128.SetYResolution(yres);
	    
	    // Let us set the one module width =
	    // 0.25 millimeters
	    Code128.SetOneModuleWidth(0.25);
	    
	    // Our barcode will contain the number  
	    // 123456789012345678901234567890 
	    Code128.SetCodeString("123456789012345678901234567890");
	    
	    // Now we are ready to draw the barcode
	    // Draw the barcode!
	    Code128.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.