Integrating Reporting

I want to use the 2D barcode in a .NET reporting tool called Telerik. The only way I can do this is to set the vaule property of an image box to the image of a barcode.

The barcode needs to be created in code, not from a file or from a DB field.

this is what I originally tried (it does not work)

dim bb as new BarcodeBuilder
bb.CodeText= "12345"
picturebox.value= bb.generateBarcodeImage

Hi Craig,


Thank you for considering Aspose.

I have checked the PictureBox control that you have mentioned in your original post and I have learned that PictureBox control can accept an Image from MemoryStream to render it. BarCodeBuilder class on the other hand enables you to save the generated barcode image to MemoryStream that in turn can be used as the value of PictureBox. Please review the sample code as below and try at your end,

VB.NET

Dim builder As New BarCodeBuilder()
builder.CodeText = “12345”
Dim stream As New MemoryStream()
builder.Save(stream, ImageFormat.Png)
stream.Position = 0
Dim image As Image = Image.FromStream(stream)
pictureBox.Value = image