{"id":1359,"date":"2009-10-26T11:15:24","date_gmt":"2009-10-26T11:15:24","guid":{"rendered":"http:\/\/www.bardecode.com\/en1\/?p=1359"},"modified":"2013-02-12T11:15:49","modified_gmt":"2013-02-12T11:15:49","slug":"getbarstringpos-position-and-page-number-for-a-barcode","status":"publish","type":"post","link":"https:\/\/www.bardecode.com\/en1\/getbarstringpos-position-and-page-number-for-a-barcode\/","title":{"rendered":"GetBarStringPos &#8211; position and page number for a barcode"},"content":{"rendered":"<p><strong><strong>Syntax<\/strong><\/strong><\/p>\n<p>&nbsp;<\/p>\n<p><strong><strong>.net:<\/strong><\/strong><\/p>\n<p><strong>System.Drawing.Rectangle Object.<strong>GetBarStringRect<\/strong>(n)<br \/>\nObject.<strong>GetBarStringPage<\/strong>(n)<\/strong><\/p>\n<p><strong><strong>com:<\/strong><\/strong><\/p>\n<p><strong>Object.<strong>BarStringPage<\/strong>(n)<br \/>\nObject.<strong>BarStringTopLeftX<\/strong>(n)<br \/>\nObject.<strong>BarStringTopLeftY<\/strong>(n)<br \/>\nObject.<strong>BarStringBottomRightX<\/strong>(n)<br \/>\nObject.<strong>BarStringBottomRightY<\/strong>(n)<\/strong><\/p>\n<p><strong><strong>ocx:<\/strong><\/strong><\/p>\n<p><strong>pageNo = Object.<strong>GetBarStringPos<\/strong>(n, &amp;TopLeftX &amp;TopLeftY, &amp;BottomRightX,\u00a0\u00a0&amp;BottomRightY)<\/strong><\/p>\n<p><strong><strong>dll:<\/strong><\/strong><\/p>\n<p><strong>pageNo =\u00a0\u00a0<strong>mtGetBarStringPos<\/strong>(hBarcode, n, &amp;TopLeftX, &amp;TopLeftY, &amp;BottomRightX, &amp;BottomRightY)<\/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 \/>\nn\u00a01-based index to barcode to be queried.<br \/>\nTopLeftX\u00a0variable to receive x coordinate of the top left hand corner of rectangle<br \/>\nTopLeftY\u00a0variable to receive x coordinate of the top left hand corner of rectangle<br \/>\nBottomRightX\u00a0variable to receive x coordinate of the bottom right hand corner of rectangle<br \/>\nBottomRightY\u00a0variable to receive y coordinate of the bottom right hand corner of rectangle<\/strong><\/p>\n<p><strong><strong>Return value<\/strong><\/strong><\/p>\n<p><strong>GetBarStringRect returns a System.Drawing.Rectangle object.<br \/>\nGetBarStringPage, GetBarStringPos, mtGetBarStringPos and BarStringPage return the page number (indexed from 1) for the barcode.<br \/>\nBarStringTopLeftX etc return the coordinates of the dounding rectangle.<\/strong><\/p>\n<p><strong><strong>Remarks<\/strong><\/strong><\/p>\n<p><strong>GetBarStringPos and the related group of functions are used to obtain the page number and bounding rectangle of a barcode. The methods available and the way in which they are called differ from interface to interface. Note that the bounding rectangle only covers the readable area of the barcode and if MultipleRead is set to false it will only cover a portion of the barcode.\u00a0<\/strong><\/p>\n<p><strong>In the case of the dll and ocx interfaces, the GetBarStringPos function returns the page number.<\/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 mtGetBarStringPos Lib &#8220;SoftekBarcode&#8221; (ByVal hBarcode As System.IntPtr, ByVal nBarCode As Short, ByRef TopLeftX As Integer, ByRef TopLeftY As Integer, ByRef BottomRightX As Integer, ByRef BottomRightY As Integer) As Short<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p><strong><strong>Visual C++:<\/strong><\/strong><\/p>\n<p><strong>short __stdcall mtGetBarStringPos(HANDLE hBarcode, short nBarCode, long FAR* pTopLeftX, long FAR* pTopLeftY, long FAR* pBotRightX, long FAR* pBotRightY);<\/strong><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Syntax &nbsp; .net: System.Drawing.Rectangle Object.GetBarStringRect(n) Object.GetBarStringPage(n) com: Object.BarStringPage(n) Object.BarStringTopLeftX(n) Object.BarStringTopLeftY(n) Object.BarStringBottomRightX(n) Object.BarStringBottomRightY(n) ocx: pageNo = Object.GetBarStringPos(n, &amp;TopLeftX &amp;TopLeftY, &amp;BottomRightX,\u00a0\u00a0&amp;BottomRightY) dll: pageNo =\u00a0\u00a0mtGetBarStringPos(hBarcode, n, &amp;TopLeftX, &amp;TopLeftY, &amp;BottomRightX, &amp;BottomRightY) Parameters hBarcode\u00a0Handle to an instance of the barcode toolkit (dll only). n\u00a01-based index to barcode to be queried. TopLeftX\u00a0variable to receive x coordinate of the top left hand<\/p>\n<p><a href=\"https:\/\/www.bardecode.com\/en1\/getbarstringpos-position-and-page-number-for-a-barcode\/\">Continue Reading &rarr;<\/a><\/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-1359","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\/en1\/wp-json\/wp\/v2\/posts\/1359"}],"collection":[{"href":"https:\/\/www.bardecode.com\/en1\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bardecode.com\/en1\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bardecode.com\/en1\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bardecode.com\/en1\/wp-json\/wp\/v2\/comments?post=1359"}],"version-history":[{"count":1,"href":"https:\/\/www.bardecode.com\/en1\/wp-json\/wp\/v2\/posts\/1359\/revisions"}],"predecessor-version":[{"id":1360,"href":"https:\/\/www.bardecode.com\/en1\/wp-json\/wp\/v2\/posts\/1359\/revisions\/1360"}],"wp:attachment":[{"href":"https:\/\/www.bardecode.com\/en1\/wp-json\/wp\/v2\/media?parent=1359"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bardecode.com\/en1\/wp-json\/wp\/v2\/categories?post=1359"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bardecode.com\/en1\/wp-json\/wp\/v2\/tags?post=1359"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}