{"id":1344,"date":"2009-10-26T11:05:59","date_gmt":"2009-10-26T11:05:59","guid":{"rendered":"http:\/\/www.bardecode.com\/newsite\/?p=1344"},"modified":"2013-02-12T11:06:28","modified_gmt":"2013-02-12T11:06:28","slug":"scanbarcodefrombitmap-scan-a-bitmap-for-barcodes","status":"publish","type":"post","link":"https:\/\/www.bardecode.com\/newsite\/scanbarcodefrombitmap-scan-a-bitmap-for-barcodes\/","title":{"rendered":"ScanBarCodeFromBitmap &#8211; scan a bitmap for barcodes"},"content":{"rendered":"<p><strong>Syntax<\/strong><\/p>\n<p>.net:\u00a0Object.ScanBarCodeFromBitmap(bitmap)<br \/>\n.net\/com\/ocx:\u00a0Object.ScanBarCodeFromBitmap(hBitmap)<br \/>\ndll:\u00a0mtScanBarCodeFromBitmap(hBarcode, hBitmap)<\/p>\n<p><strong>Parameters<\/strong><\/p>\n<p>hBarcode\u00a0Handle to an instance of the barcode toolkit (dll only).<br \/>\nbitmap\u00a0System.Drawing.Bitmap object<br \/>\nhBitmap\u00a0handle (HBITMAP) to a bitmap.<\/p>\n<p><strong>Return Value<\/strong><\/p>\n<p>-1\u00a0N\/A<br \/>\n-2\u00a0Bitmap is multi-plane<br \/>\n-3\u00a0Invalid number of bits per sample<br \/>\n-4\u00a0Memory allocation error<br \/>\n-5\u00a0N\/A<br \/>\n-6,-7,-8\u00a0Invalid license key.<\/p>\n<p><strong>Remarks<\/strong><\/p>\n<p>Scan the specified device dependent bitmap for bar code strings and return the number of bar codes found. The image must be single plane. Note that hBitmap is a HANDLE to a BITMAP, not the address of a BITMAP structure.\u00a0\u00a0The Windows GDI function, CreateBitmapIndirect can be used to create an HBITMAP from a BITMAP structure. Note that the function will stop when the first barcode is found in a document unless the\u00a0MulipleRead\u00a0property is set to True.<\/p>\n<p>The managed component supports 2\u00a0forms of this function:<\/p>\n<p>ScanBarCodeFromBitmap(IntPtr hBitmap)<\/p>\n<p>ScanBarCodeFromBitmap(System.Drawing.Bitmap bitmap) (Managed Component Only)<\/p>\n<p>Scan the specified managed bitmap object for bar code strings and return the number of bar codes found.<\/p>\n<p>See also:\u00a0ScanBarcodeFromDIB<\/p>\n<p>Photometric<\/p>\n<p><strong>Win32 dll declarations:<\/strong><\/p>\n<p><strong>VB.Net:<\/strong><\/p>\n<p>Private Declare Function mtScanBarCodeFromBitmap Lib &#8220;SoftekBarcode&#8221; (ByVal hBarcode As System.IntPtr,\u00a0ByVal hBitmap As IntPtr) As Short<\/p>\n<p><strong><strong><strong><br \/>\n<\/strong><\/strong><\/strong><\/p>\n<p>&nbsp;<\/p>\n<p><strong>Visual C++:<\/strong><\/p>\n<p>extern &#8220;C&#8221; {<br \/>\nshort __stdcall mtScanBarCodeFromBitmap(HANDLE hBarcode, long hBitmap);<br \/>\n}<\/p>\n<div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Syntax .net:\u00a0Object.ScanBarCodeFromBitmap(bitmap) .net\/com\/ocx:\u00a0Object.ScanBarCodeFromBitmap(hBitmap) dll:\u00a0mtScanBarCodeFromBitmap(hBarcode, hBitmap) Parameters hBarcode\u00a0Handle to an instance of the barcode toolkit (dll only). bitmap\u00a0System.Drawing.Bitmap object hBitmap\u00a0handle (HBITMAP) to a bitmap. Return Value -1\u00a0N\/A -2\u00a0Bitmap is multi-plane -3\u00a0Invalid number of bits per sample -4\u00a0Memory allocation error -5\u00a0N\/A -6,-7,-8\u00a0Invalid license key. Remarks Scan the specified device dependent bitmap for bar code strings and return &hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[236,18],"tags":[],"class_list":["post-1344","post","type-post","status-publish","format-standard","hentry","category-documentation-for-our-toolkits-and-applications","category-knowledge-base"],"_links":{"self":[{"href":"https:\/\/www.bardecode.com\/newsite\/wp-json\/wp\/v2\/posts\/1344"}],"collection":[{"href":"https:\/\/www.bardecode.com\/newsite\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bardecode.com\/newsite\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bardecode.com\/newsite\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bardecode.com\/newsite\/wp-json\/wp\/v2\/comments?post=1344"}],"version-history":[{"count":1,"href":"https:\/\/www.bardecode.com\/newsite\/wp-json\/wp\/v2\/posts\/1344\/revisions"}],"predecessor-version":[{"id":1345,"href":"https:\/\/www.bardecode.com\/newsite\/wp-json\/wp\/v2\/posts\/1344\/revisions\/1345"}],"wp:attachment":[{"href":"https:\/\/www.bardecode.com\/newsite\/wp-json\/wp\/v2\/media?parent=1344"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bardecode.com\/newsite\/wp-json\/wp\/v2\/categories?post=1344"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bardecode.com\/newsite\/wp-json\/wp\/v2\/tags?post=1344"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}