Free Support Forum - aspose.com

SetHints - ScanStrengthHints.Strong option obsolete

Hi,

I'm now evaluating the latest version of Aspose.BarCode library, came across an issue with SetHints method. This method is now obsolete, am wondering how to rewrite the code to get the same (or at least the closest) behaviour as the original one.

original code (using older version of BarCode lib), VB.NET:
rd.SetHints(RecognitionHints.ImageBinarizationHints.MedianSmoothing Or
RecognitionHints.ImageBinarizationHints.Grayscale Or
RecognitionHints.ScanStrengthHints.Strong)


new code:
rd.ImageBinarizationHints = RecognitionHints.ImageBinarization.MedianSmoothing Or
RecognitionHints.ImageBinarization.Grayscale

Is that correct? How to set the RecognitionHints.ScanStrengthHints.Strong option in the new version? Have not found anything that looks like that neither via VS intellisense nor in documentation...

thanks

Jiri

Hi Jiri,


Thanks for your inquiry. It is to update you that the RecognitionHints.ScanStrengthHints enum has been obsoleted. So there is no alternative. First, please try a simple source code e.g.

Dim reader As BarCodeReader<o:p></o:p>

reader = New BarCodeReader("C:\SamplePic\128.jpg", BarCodeReadType.Code128)

'target barcode is Code128 or EAN128 types of barcode

Do While reader.Read()

Console.Write("Code Text: " & reader.GetCodeText())

Console.Write("Symbology Type: " & reader.GetReadType().ToString())

Loop

reader.Close()


If it does not help then you can apply image processing techniques like MedianSmoothing removes the noise from the image while preserving the image edges. Please visit the documentation link below:
http://www.aspose.com/docs/display/barcodenet/Better+and+Faster+Image+Processing+for+BarCode+Recognition

It also contains the support to rotate the barcode image manually and then perform the recognition. It is recommended to apply appropriate symbology and Orientation.
http://www.aspose.com/docs/display/barcodenet/Barcode+Orientation

Please let us know in case of further assistance and comments.