Softek Software Barcode Reading Toolkits
HOME PRODUCTS DEVELOPERS STORE ABOUT US
Developer Home
Downloads
Sample Code
Support

Help -> Methods -> GetBarStringPosand

The Softek Barcode Reader SDK extracts barcode information from images and bitmaps.

GetBarStringPos and GetBarStringRect 

Overview

GetBarStringPos(n, &TopLeftX, &TopLeftY, &BottomRightX, &BottomRightY)

System.Drawing.Rectangle GetBarStringRect(n)              (.Net managed component only)

In the COM object the following properties are also available:

BarStringPage(n), BarStringTopLeftX(n), BarStringTopLeftY(n), BarStringBottomRightX(n), BarStringBottomRightY(n)

GetBarStringPos returns the page number of the nth bar code found in the image - where n is indexed from 1. The page number is also indexed from 1. Call GetBarStringPos after ScanBarCode. TopLeftX, TopLeftY etc receive the coordinates of the rectangle that bounds the barcode. Note that this may only cover part of the height of the barcode.

GetBarStringRect returns the bounding rectangle that surrounds the barcode.

BarStringPage and BarStringTopLeftX etc allow access to the page number and position of a barcode through the COM object interface. This is useful when working with VB Script.

Visual Basic using the OCX

Dim n As Integer
Dim TopLeftX As Long
Dim TopLeftY As Long
Dim BottomRightX As Long
Dim BottomRightY As Long

[form.]SoftekBarcode.GetBarStringPos (n, TopLeftX, TopLeftY, BottomRightX, BottomRightY) 

Visual Basic using the DLL

Private Declare Function stGetBarStringPos Lib "SoftekBarcode" (ByVal nBarCode As Integer, ByRef TopLeftX As Long, ByRef TopLeftY As Long, ByRef BottomRightX As Long, ByRef BottomRightY As Long) As Integer

Dim n As Integer
Dim TopLeftX As Long
Dim TopLeftY As Long
Dim BottomRightX As Long
Dim BottomRightY As Long

page = stGetBarStringPos(n, TopLeftX, TopLeftY, BottomRightX, BottomRightY)

Visual Basic using COM

oBar = CreateObject("SoftekATL.Barcode")
.........
oBar.GetBarStringPos (n, TopLeftX, TopLeftY, BottomRightX, BottomRightY) 
page = oBar.BarStringPage(n)

or

page = oBar.BarStringPage(n)
TopLeftX = oBar.BarStringTopLeftX(n)
TopLeftY = oBar.BarStringTopLeftY(n)
BottomRightX = oBar.BarStringBottomRightX(n)
BottomRightY = oBar.BarStringBottomRightY(n)

 

VB.Net using the DLL

Private Declare Function stGetBarStringPos Lib "SoftekBarcode" (ByVal nBarCode As Short, ByRef TopLeftX As Long, ByRef TopLeftY As Long, ByRef BottomRightX As Long, ByRef BottomRightY As Long) As Short

Dim n As Short
Dim TopLeftX As Long
Dim TopLeftY As Long
Dim BottomRightX As Long
Dim BottomRightY As Long

page = stGetBarStringPos(n, TopLeftX, TopLeftY, BottomRightX, BottomRightY)

VB.Net using the SoftekBarcode Wrapper Class

Dim barcode As SoftekBarcode

Dim n As Short
Dim TopLeftX As Long
Dim TopLeftY As Long
Dim BottomRightX As Long
Dim BottomRightY As Long

..........
barcode.GetBarStringPos(n, TopLeftX, TopLeftY, BottomRightX, BottomRightY)

VB.Net using the SoftekBarcodeLib Managed Component

Dim barcode As SoftekBarcodeLib.BarcodeReader
Dim rect as System.Drawing.Rectangle
..........
barcode = New SoftekBarcodeLib.BarcodeReader()
..........
barcode.GetBarStringRect(n)

Visual C++ Using the OCX

short GetBarStringPos (short n, long *pTopLeftX, long *pTopLeftY, long *pBottomRightX, long *pBottomRightY);

Visual C++ Using the DLL

short __stdcall stGetBarStringPos(short nBarCode, long FAR* pTopLeftX, long FAR* pTopLeftY, long FAR* pBotRightX, long FAR* pBotRightY);