This is a migrated thread and some comments may be shown as answers.

Barcode Reader

3 Answers 278 Views
BarCode
This is a migrated thread and some comments may be shown as answers.
Joel Palmer
Top achievements
Rank 2
Joel Palmer asked on 20 Oct 2014, 05:37 PM
I've been playing with your Barcode Reader and assume I am doing something wrong or missing something. 

First, is there a way to "push the Open button" from the library?  When I produce a barcode image, I'd like to just have it read that when I ask in code... not from the button.

Secondly and more important, I can't get a good read.  I have created a demo app that I'd be happy to share.  I print a 128 barcode to PNG file.  Then, I attempt to read the value back using the reader and it never returns the value I entered into the barcode.

Output Barcode to PNG File:
SaveFileDialog dialog = new SaveFileDialog()
{
    DefaultExt = "png",
    Filter = "png (*.png)|*.png"
};
 
if (dialog.ShowDialog() == true)
{
    using (Stream stream = dialog.OpenFile())
    {
        Telerik.Windows.Media.Imaging.ExportExtensions.ExportToImage(
            barCode,
            stream,
            new PngBitmapEncoder());
    }
}

Let me know if you want me to upload my demo app.
Joel

3 Answers, 1 is accepted

Sort by
0
Tsvetie
Telerik team
answered on 23 Oct 2014, 12:03 PM
Hello Joel,

You can use the BarcodeDecoder class to decode images without the necessity of user interacting with the UI of the RadBarcode control to select an image. For example:

BarcodeDecoder decoder = new BarcodeDecoder();
decoder.ImageSource = new BitmapImage(uri);
decoder.DecodingComplete += Decoded;
decoder.StartDecoding();

I tested your code that exports the barcode control and the problem that I encountered when reading the exported image, was a result of the transparency. In order to resolve this problem you can set the Background of the control before exporting it. For example:
<telerik:RadBarcode128 Grid.Column="1" x:Name="barCode" Height="90" Width="370" Text="CODE 128"
    Background="White" />

On a side note, I would like to note that our barcode reader does not deal well with distorted, tilted or blurry images. In case this is a requirements for your application, I would recommend that you test the control thoroughly in order to decide whether it meets your requirements.

Regards,
Tsvetie
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
ashhad
Top achievements
Rank 1
answered on 12 Nov 2015, 09:33 AM

Hi Joel I want your demo project. Please Upload your demo project.

Thanks

0
Joel Palmer
Top achievements
Rank 2
answered on 12 Nov 2015, 04:56 PM
It has been an entire year.  I'll forward it on to you when I come across it.
Tags
BarCode
Asked by
Joel Palmer
Top achievements
Rank 2
Answers by
Tsvetie
Telerik team
ashhad
Top achievements
Rank 1
Joel Palmer
Top achievements
Rank 2
Share this question
or