RBM Binary Image now displays barcode using Code39

December 11, 2009 · Posted in .NET, ASP.NET, C# · Comment 

RBMBinaryImage Source Code

Introduction

It’s been a while since I lost wrote on my blog yesterday one of my friends was asking me how to display Barcode in asp.net, There is a great open source code written by Bart De Smet which could return a bar code image from a bar code string you could see his article here I have just added to it one small option of whether or not to display the code under the bar code. The library returns an Image I thought of adding the display of bar code from the bar code string value, functionality to RBMBinaryImage would be cool.

RbmBinaryImageBarCode

Bar Code and Binary Image Screen shot

Using the Code

The idea was simple since, the Code39 Library returns already an Image object so I only got it’s bytes and passed it to the ImageContent Property which is then rendered in the image. for more information on how the binary image display works in RBMBinaryImage please visit the post here. Again the usage of the control is still easy, to display the bar code you only need to set the PrintBarcode property to true, and pass the BarCodeValue the bar code as you could see below the DisplayThumbnail Property still is being applied on the bar code.

<Rbm:RbmBinaryImage ID="RbmBinaryImage2" runat="server" PrintBarcode="true"  BarCodeValue='<%# Eval("BarCode") %>' DisplayThumbnail="true"   ThumbnailSize="160"  EmptyImageUrl="images/NoPhoto.JPG" />

I have made one change to the HttpHandler to be with the extension of the .ashx instead of the .rbm extension to be standard

<httpHandlers>
<add verb="GET" path="__RbmImageHandler.ashx" type="RbmControls.RbmImageHandler"/>
</httpHandlers>

Finally, you could find the code here

























































download movies

ñêà÷àòü ôèëüìû