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

Help -> Properties -> ColorThreshold

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

ColorThreshold 

Overview

ColorThreshold is the color value used by the control to decide whether a pixel should be considered to be black or white. The value should be in the range 0 to 255.

If ColorThreshold has a value of 0 then the toolkit will perform a median analysis of the image to determine the best value to use.

Default value = 128

Visual Basic using the OCX

[form.]SoftekBarcode.ColorThreshold = value

Visual Basic using the DLL

Private Declare Function stGetColorThreshold Lib "SoftekBarcode" () As Integer
Private Declare Function stSetColorThreshold Lib "SoftekBarcode" (ByVal newValue As Integer) As Integer
stSetColorThreshold (value)
value = stGetColorThreshold ()

Visual Basic using COM

oBar = CreateObject("SoftekATL.Barcode")
.........
oBar.ColorThreshold = value
value = oBar.ColorThreshold

VB.Net using the DLL

Private Declare Function stGetColorThreshold Lib "SoftekBarcode" () As Short
Private Declare Function stSetColorThreshold Lib "SoftekBarcode" (ByVal newValue As Short) As Short
stSetBitmapResolution(value)
value = stGetBitmapResolution()

VB.Net using the SoftekBarcode Wrapper Class

Dim barcode As SoftekBarcode
..........
barcode.SetColorThreshold(value)
value = barcode.GetColorThreshold()

VB.Net using the SoftekBarcodeLib Managed Component

Dim barcode As SoftekBarcodeLib.BarcodeReader
Dim value As Long
..........
barcode = New SoftekBarcodeLib.BarcodeReader()
..........
barcode.ColorThreshold = value
value = barcode.ColorThreshold

Visual C++ Using the OCX

short GetColorThreshold() ;
void SetColorThreshold (short value);

Visual C++ Using the DLL

short __stdcall stGetColorThreshold() ;
short __stdcall stSetColorThreshold (short value);