Key in your Email here. You will be entered into a Special Lucky Draw!
 

Using SmartCodeDeveloper to Create Barcode Images in a Windows Presentation Application (WPF)

This tutorial demonstrates the creation of a WPF application using SmartCodeDeveloper. The BMP image returned by SmartcodeDeveloper is used as an image source for the WPF image control.

Pre-requisites

The .Net Framework 3 SDK and its Visual Studio 2005 extension has to be already installed on your machine.

SDK for Windows Vista and .NET Framework 3.0
Visual Studio 2005 extensions for .NET Framework 3.0

Steps

1) To get started, go to File::New Project in Visual Studio 2005, and select Windows Application (WPF). Name the project WPFBarcode.


2) We will now add an Image control to our form to host the barcode. Open the Window1.xaml file using the XML Editor. Make changes to this file so that the Width of the window is now 500. Insert the image control <Image Margin="36,45,54,126" Name="image1" /> within the <Grid> ... </Grid> tags.

The XAML file should now look like this

<Window x:Class="WPFBarcode.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="WPFBarcode" Height="300" Width="500"    >
<Grid>
      <Image Margin="36,45,54,126" Name="image1" />    </Grid>
</Window>




3) Next, we will add code to the Window1.xaml.cs file so that a barcode will be drawn when the window loads. Copy the block of code below to the Window1.xaml.cs file.

The DrawBarcode method uses the SmartCodeDeveloper control to create a BMP image in an array of bytes. The array of bytes is then passed through a BmpBitmapDecoder and converted to a BitmapSource, which is used to set the Source property of the Image control (image1).

public Window1()
{
InitializeComponent();
DrawBarcode();
}

void DrawBarcode()
{
TechnoRiver.SmartCodeDeveloper.SmartCodeDeveloperControl scd = new TechnoRiver.SmartCodeDeveloper.SmartCodeDeveloperControl();
scd.BarcodeData = "10252345";
scd.Symbology = TechnoRiver.SmartCodeDeveloper.SmartCodeDeveloperControl.BarcodeSymbology.CODE128;
scd.DisplayText = TechnoRiver.SmartCodeDeveloper.SmartCodeDeveloperControl.BarcodeDisplayText.Yes;
byte[] imgbyte = scd.GetImageBMP();
System.IO.MemoryStream ms = new System.IO.MemoryStream(imgbyte);
BmpBitmapDecoder decoder = new BmpBitmapDecoder(ms, BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.Default);
BitmapSource bs = decoder.Frames[0];

image1.Source = bs;
}

3) Add a reference to SmartCodeDeveloper. Right click on the WPFBarcode project and select Add Reference.


4) Click the Browse Tab and navigate to SmartCodeDeveloper.dll. The default location for the dll is at C:\Program Files\TechnoRiver\SmartCodeDeveloper\SmartCodeDeveloper.dll


5) Add a reference to System.Windows.Forms.


6) We are now ready to run the WPF application. The result should look as follows.


Mar 10, 2008

SmartCodeDeveloper (v3.0) - New
Next Generation Barcodes and XBAP Support

Technoriver is pleased to announce the release of SmartCodeDeveloper 3.0. This version adds several important barcode symbologies GS1 DataBar-14, GS1 DataBar Limited, GS1 DataBar Stacked, GS1 DataBar Truncated and GS1-128. The GS1 DataBar family is expected to be the next generation barcodes that will be used on many trade items. A new control is also provided for developing (RIA) Rich Internet Application in XBAP. With the new control, you can deploy state-of-the-art web-based barcode applications for Windows Vista users.

more info

Feb 25, 2008

TechnoRiverStudio(v4.5) - New!
(formerly SmartCodeStudio)
Technoriver brings labeling to the next level by introducing the Autowrap Fitting Text into its barcode labeling software. This text object allows easir handling of long text strings by breaking them down into several lines and then resizing them to fit within a bounding box. The barcodes produced in this version are also updated with the latest barcode specifications. This includes ISBN 13, the new 13-digit ISMN, GS1 DataBar-14, GS1 DataBar Limited, GS1 DataBar Stacked, GS1 DataBar Truncated and GS1-128.

more info

Oct 3, 2007

SmartCodeStudio(v4.0)
This version updates the software with a MICR (Magnetic Ink Character Recognition) feature that facilitates the printing of checks using magnetic ink. A new datasource, known as Pick List, is introduced to let users define a list of items quickly as an alternative to database. Also, a few barcodes helpers are improved and the UCCEAN dialog has been extended to support custom application identifiers.

more info

Aug 1, 2007

SmartCodeDeveloper 2.8
SmartCodeDeveloper .Net Barcode Software Control updated to work with Crystal Reports, Web Services, Databinding and Windows Presentation Foundation (.Net 3).

more info

SmartCodeStudio is  one of the most innovative and  productive label design and print tools available. It is currently being used by many Fortune 500 companies including hospitals, universities, manufacturers, retailers, municipalities, and government institutions in many different countries around the world.

Product Overview
Product Brochure (PDF)
Editions
Frequently Asked Questions
General Support
Downloads
Resellers
Awards
Testimonials

COPYRIGHT (C) 2004-2006 ALL RIGHTS RESERVED, TECHNORIVER
HOME  ::  PURCHASE  ::  DOWNLOADS  ::  SUPPORT  ::  OUR PRODUCTS  ::  RESELLERS  ::  ABOUT US