Introduction
LEADTOOLS Version 18, also known as LEADTOOLS Anywhere™,
provides the most comprehensive and highest quality imaging SDK technology on
the widest variety of development platforms including WinRT, Windows Phone,
HTML5, iOS, OS X, Android and Linux. Viewers, annotations and markups, barcode,
OCR, PDF, image formats, compression, image processing and more are just a
sampling of what LEADTOOLS has to offer any developer, not just those targeting
Windows.
Programmers using LEADTOOLS can experience a set of libraries
that closely resemble each other on every development platform. This is a
distinct advantage for developers whose goal is to create native versions of
their apps on multiple platforms. Even if your plan is to develop for a single
platform, LEADTOOLS provides a programmer friendly interface for every major
platform out there, giving developers the flexibility and peace of mind to
easily expand in the future.
Key Features in LEADTOOLS Anywhere™ SDKs
-
Image Viewer Controls designed specifically for .NET, HTML5, WinRT,
Windows Phone, iOS, OS X and Android
-
Load, convert and save more than 150 image formats
-
Advanced bit depth, color space and compression support for
common formats including PDF, PDF/A, JPEG, JPEG 2000, TIFF, JBIG2 and more
-
Barcode reading and writing for QR, PDF417, Data Matrix, UPC/EAN
and more
-
OCR to convert images to searchable text, PDF and DOC
-
Comprehensive Annotation and Markup including geometric shapes,
sticky note, redact, highlight and rubber stamp
-
Over 200 Image processing functions for enhancing, correcting and
manipulating images
Reading Barcodes on Each Platform
In the examples that follow, we’ll show how to convert a
platform-native image into a LEADTOOLS RasterImage
, and
then use the Barcode engine to get its symbology (i.e. UPC/EAN, Code 128, QR
Code, Data Matrix, etc.), location and encoded value. Alternatively,
developers can use the RasterCodecs
object to load and
save their images. However, using LEAD’s conversion utilities is a powerful
asset for existing applications because it requires minimal changes to your
current code base.
.NET
System.Drawing.Bitmap bitmap = ... RasterImage rasterImage = RasterImageConverter.FromImage(bitmap);
private BarcodeEngine barcodeEngine = new BarcodeEngine();
BarcodeData barcodeData = barcodeEngine.Reader.ReadBarcode(rasterImage,
LogicalRectangle.Empty, BarcodeSymbology.Unknown);
if (barcodeData != null) {
Console.WriteLine("Symbology:{0}", barcodeData.Symbology);
Console.WriteLine("Location:{0},{1},{2},{3}", barcodeData.Bounds.X,
barcodeData.Bounds.Y, barcodeData.Bounds.Width, barcodeData.Bounds.Height);
Console.WriteLine("Value:{0}", barcodeData.Value);
} else {
Console.WriteLine("No barcodes found");
}
WinRT & Windows Phone
Windows.UI.Xaml.Media.ImageSource imageSource = ... RasterImage rasterImage = RasterImageConverter.ConvertFromImageSource(
imageSource, ConvertFromImageOptions.None);
private BarcodeEngine barcodeEngine = new BarcodeEngine();
BarcodeData barcodeData = barcodeEngine.Reader.ReadBarcode(rasterImage,
LogicalRectangle.Empty, BarcodeSymbology.Unknown);
if (barcodeData != null) {
Console.WriteLine("Symbology:{0}", barcodeData.Symbology);
Console.WriteLine("Location:{0},{1},{2},{3}", barcodeData.Bounds.X,
barcodeData.Bounds.Y, barcodeData.Bounds.Width, barcodeData.Bounds.Height);
Console.WriteLine("Value:{0}", barcodeData.Value);
} else {
Console.WriteLine("No barcodes found");
}
iOS & OS X
UIImage* uiImage = ... LTRasterImage* rasterImage = [LTRasterImageConverter convertFromImage:uiImage
options:LTConvertFromImageOptions_None error:nil];
LTBarcodeEngine* barcodeEngine = [LTBarcodeEngine new];
LTBarcodeData* barcodeData = [barcodeEngine.reader readBarcode:rasterImage
searchBounds:LeadRect_Empty() symbologies:nil symbologiesCount:0 error:nil];
if(barcodeData != nil) {
NSLog(@"Symbology:%u", barcodeData.symbology);
NSLog(@"Location:%u,%u,%u,%u", barcodeData.bounds.x, barcodeData.bounds.y,
barcodeData.bounds.width, barcodeData.bounds.height);
NSLog(@"Value:%@", barcodeData.value);
} else {
NSLog(@"No barcodes found");
}
Android
android.graphics.Bitmap bitmap = ... RasterImage rasterImage = RasterImageConverter.convertFromBitmap(
bitmap, ConvertFromImageOptions.NONE);
private BarcodeEngine barcodeEngine = new BarcodeEngine();
BarcodeData barcodeData = barcodeEngine.getReader().readBarcode(
rasterImage, LeadRect.getEmpty(), BarcodeSymbology.UNKNOWN);
if (barcodeData != null) {
Log.i("LEADTOOLS.BarcodeDemo", String.format("Symbology:%s", barcodeData.getSymbology()));
Log.i("LEADTOOLS.BarcodeDemo", String.format("Location:%1$s,%2$s,%3$s,%4$s",
barcodeData.getBounds().getX(), barcodeData.getBounds().getY(),
barcodeData.getBounds().getWidth(), barcodeData.getBounds().getHeight()));
Log.i("LEADTOOLS.BarcodeDemo", String.format("Value:%s", barcodeData.getValue()));
} else {
Log.i("LEADTOOLS.BarcodeDemo", "No barcodes found");
}
Download the Full Examples
You can download fully functional demos which includes the
features discussed above. To run these examples you will need the following:
Support
Need help getting this sample up and going? Contact
our support team for free technical support! For pricing or licensing
questions, you can contact our sales team (sales@leadtools.com)
or call us at 704-332-5532.