{"id":1340,"date":"2009-10-26T11:02:53","date_gmt":"2009-10-26T11:02:53","guid":{"rendered":"http:\/\/www.bardecode.com\/newsite\/?p=1340"},"modified":"2013-02-12T11:03:23","modified_gmt":"2013-02-12T11:03:23","slug":"setscanrect-specify-the-rectangle-to-search-within-an-image","status":"publish","type":"post","link":"https:\/\/www.bardecode.com\/newsite\/setscanrect-specify-the-rectangle-to-search-within-an-image\/","title":{"rendered":"SetScanRect &#8211; specify the rectangle to search within an image"},"content":{"rendered":"<p><strong><strong>Syntax<\/strong><\/strong><\/p>\n<p>&nbsp;<\/p>\n<p><strong>.net\/com\/java\/ocx:\u00a0SetScanRect(tlx, tly, brx, bry, mode)<br \/>\ndll:\u00a0mtSetScanRect(hBarcode,\u00a0tlx, tly, brx, bry, mode)<\/strong><\/p>\n<p><strong><strong>Parameters<\/strong><\/strong><\/p>\n<p><strong>hBarcode\u00a0Handle to an instance of the barcode toolkit (dll only).<br \/>\ntlx\u00a0x coordinate of top left hand corner<br \/>\ntly\u00a0y coordinate of top left hand corner<br \/>\nbrx\u00a0x coordinate of bottom right hand corner<br \/>\nbry\u00a0y coordinate of bottom right hand corner<br \/>\nmode\u00a0mapping mode (see below)<\/strong><\/p>\n<p><strong><strong>Return Value<\/strong><\/strong><\/p>\n<p><strong>1\/True on success and 0\/False on failure.<\/strong><\/p>\n<p><strong><strong>Remarks<\/strong><\/strong><\/p>\n<p><strong>SetScanRect specifies the bounding rectangle in the image that should be searched for barcodes. To clear the rectangle and search the entire image set the rectangle to (-1, -1, -1, -1). The top left hand corner of an image is (0,0).<\/strong><\/p>\n<p><strong>The mapping mode can have the following values:<\/strong><\/p>\n<p><strong>0 =\u00a0All measurements are in pixels.<\/strong><\/p>\n<p><strong>1 = All measurements are a percentage of the width or height of the image.<\/strong><\/p>\n<p><strong><strong>Win32 dll declarations:<\/strong><\/strong><\/p>\n<p><strong><strong>VB.Net:<\/strong><\/strong><\/p>\n<p><strong>Private Declare Function mtSetScanRect Lib &#8220;SoftekBarcode&#8221; (ByVal hBarcode As System.IntPtr, ByVal TopLeftX As Integer, ByVal TopLeftY As Integer, ByVal BottomRightX As Integer, ByVal BottomRightY As Integer, ByVal MappingMode As Short) As Boolean<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p><strong><strong>Visual C++:<\/strong><\/strong><\/p>\n<p><strong>extern &#8220;C&#8221; {<br \/>\nBOOL __stdcall mtSetScanRect(HANDLE hBarcode, long TopLeftX, long TopLeftY, long BottomRightX, long BottomRightY, short MappingMode);<\/strong><\/p>\n<p><strong>}<\/strong><\/p>\n<div><strong><br \/>\n<\/strong><\/div>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Syntax &nbsp; .net\/com\/java\/ocx:\u00a0SetScanRect(tlx, tly, brx, bry, mode) dll:\u00a0mtSetScanRect(hBarcode,\u00a0tlx, tly, brx, bry, mode) Parameters hBarcode\u00a0Handle to an instance of the barcode toolkit (dll only). tlx\u00a0x coordinate of top left hand corner tly\u00a0y coordinate of top left hand corner brx\u00a0x coordinate of bottom right hand corner bry\u00a0y coordinate of bottom right hand corner mode\u00a0mapping mode (see below) &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-1340","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\/1340"}],"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=1340"}],"version-history":[{"count":1,"href":"https:\/\/www.bardecode.com\/newsite\/wp-json\/wp\/v2\/posts\/1340\/revisions"}],"predecessor-version":[{"id":1341,"href":"https:\/\/www.bardecode.com\/newsite\/wp-json\/wp\/v2\/posts\/1340\/revisions\/1341"}],"wp:attachment":[{"href":"https:\/\/www.bardecode.com\/newsite\/wp-json\/wp\/v2\/media?parent=1340"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bardecode.com\/newsite\/wp-json\/wp\/v2\/categories?post=1340"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bardecode.com\/newsite\/wp-json\/wp\/v2\/tags?post=1340"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}