How to create rotated and transparent barcode images
Product Barcode Professional for ASP.NET Published 02/24/2006 Updated 02/24/2006
Requirements
Neodynamic Barcode Professional 2.0 for ASP.NET (WebControl)
Microsoft .NET Framework (any version)
Microsoft Visual Studio .NET (any version)
You can render barcode images with transparent background setting Barcode Professional's BackColor property to Transparent. Transparent refers to System.Drawing.Color.Transparent.
If you want that the barcode image is rotated, set the Rotate property to one of the available values. You can rotate the barcode image to 90, 180, and 270 degrees.
In the following sample we're going to create a simple ASP.NET WebForm that shows these features.
Follow these steps
- Open your .NET development tool - such as Visual Studio .NET - and create a new ASP.NET Web Application.
- Drag and Drop a Barcode Professional control and a DropDownList control onto the WebForm design surface.
- In order to see the transparent background feature create a DIV tag to enclose the barcode control. We've set the background color of the DIV to palegreen color. To get transparent barcode images set the Barcode Professional's BackColor property to Transparent.
- Then select the DropDownList control and add four items that indicates rotate angles and set the AutoPostBack property to True.
- Write code for the SelectedIndexChanged event procedure to set the Rotate property:
VB
Select Case DropDownList1.SelectedValue Case "0" BarcodeProfessional1.Rotate = Rotate.None Case "90" BarcodeProfessional1.Rotate = Rotate.Degree90 Case "180" BarcodeProfessional1.Rotate = Rotate.Degree180 Case "270" BarcodeProfessional1.Rotate = Rotate.Degree270 End SelectC#
switch(DropDownList1.SelectedValue) { case "0": BarcodeProfessional1.Rotate = Rotate.None; break; case "90": BarcodeProfessional1.Rotate = Rotate.Degree90; break; case "180": BarcodeProfessional1.Rotate = Rotate.Degree180; break; case "270": BarcodeProfessional1.Rotate = Rotate.Degree270; break; }
That's it. Build the ASP.NET Web Application and run it.
Need help? Contact Support
We provide best-in-class customer service and support directly from members of our dev team! If we are available when you contact us, you will get a response in few minutes; otherwise the maximum turnaround is 24hs in most cases.