條碼控件Barcode Xpress可 以處理1位黑白圖像、8位灰度圖像以及24位彩色圖像。在Barcode Xpress中能夠使用ColorDepth方法或是在Barcode Xpress組件中的其餘的方法能夠轉換其他的圖像格式,若是你使用的是ImageGear的話,那麼直接使用ConvertColorSpace方法就 能夠了。 spa
C++示例:使用Barcode Xpress導入圖像 code
1
2
3
4
5
6
7
8
9
10
11
|
//load a 1BPP, black and white image into the ImagXpress control
m_pImagXpress->FileName = 「C:\\testbarcodeimage.tif」;
// Copy the hDib
long hDib = m_pImagXpress->CopyDIB();
// Analyze the barcode
m_pBarcodeXpress->AnalyzehDib(hDib);
// Free the hDib
GlobalFree(LongToHandle(hDib));
|
VB示例:使用Barcode Xpress導入圖像 orm
1
2
3
4
5
6
7
8
9
10
11
|
' Load the image
ImagXpress1.FileName ="C:\testbarcodeimage.tif"
' Copy the hDib
hDib = ImagXpress1.CopyDIB
' Analyze the barcode
BarcodeXpress1.AnalyzehDib hDib
' Free the hDib
GlobalFree hDib
|
C++示例:使用ImageGear導入圖像 ci
1
2
3
4
5
6
7
8
9
10
11
12
13
|
// Create an ImageGear page
GearCORELib::IIGPagePtr page;
page = g_pIGCore->CreatePage();
// Load the page from file
m_pIGFormats->LoadPageFromFile(page, fileName, 0);
// Export the page to a dib
GearCORELib::IIGPlatformDIBPtr platformDib = page->PlatformDIBExport(GearCORELib::IG_DIB_EXPORT_FORMAT_WINDOWS,false, 0, 0, page->ImageWidth, page->ImageHeight, 0);
HGLOBALhDib = LongToHandle(platformDib->DIBPtrGet());
// Read the barcodes
pBarcodeXpress->AnalyzehDib(HandleToLong(hDib));
|
VB示例:使用ImageGear導入圖像 get
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
' Load the Page
DimpageAsNewIGPage
IGFormatsCtl1.LoadPageFromFile page, fileName, 0
' Export the platform dib from the page
DimplatformDibAsIGPlatformDIB
SetplatformDib = page.PlatformDIBExport(IG_DIB_EXPORT_FORMAT_WINDOWS,False, 0, 0, page.ImageWidth, page.ImageHeight, 0)
' Get the dib handle
DimhDibAsLong
hDib = platformDib.DIBPtrGet
' Read the barcodes on the image
bcx8.AnalyzehDib hDib
|
>>>Barcode Xpress 下載 it