bardecode.com

  • Increase font size
  • Default font size
  • Decrease font size
Home Documentation GetBarStringPos - position and page number for a barcode

GetBarStringPos - position and page number for a barcode

Overview

GetBarStringPos, GetBarStringRect, BarStringPage, BarStringTopLeftX etc 

GetBarStringPos and the related group of functions are used to obtain the page number and bounding rectangle of a barcode.

The DLL and OCX interfaces support the function:

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

The COM object supports the following functions:

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

And the .Net components use the following methods:

System.Drawing.Rectangle GetBarStringRect(n)
GetBarStringPage(n)

Where n is a 1 based index to the barcode in question. The page number is also index from 1. 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.

 

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

Note that the GetBarStringPos function is also available in the COM object, but VB script writers will find it easier to just use the BarStringTopLeftX, BarStringTopLeftY etc functions.

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);