Thanks for downloading Dynamsoft Barcode Reader Package!
Your download will start shortly. If your download does not begin, click here to retry.
Method | Description |
---|---|
DecodeFile |
Decode barcodes from a specified image file. |
DecodeFileInMemory |
Decode barcodes from an image file in memory. |
DecodeBuffer |
Decode barcodes from raw buffer. |
DecodeBase64String |
Decode barcodes from a base64 encoded string. |
DecodeBitmap |
Decodes barcode from a bitmap. |
Decode barcodes from a specified image file.
TextResult[] Dynamsoft.Barcode.BarcodeReader.DecodeFile(string fileName, string templateName)
[in] fileName
<string> : A string defining the file name.
[in] templateName
<string> : The template name.
All barcode text results decoded successfully.
BarcodeReaderException
The exception thrown by Dynamsoft Barcode Reader.
BarcodeReader reader = new BarcodeReader();
reader.ProductKeys = "t0260NwAAAHV***************";
TextResult[] result = reader.DecodeFile(@"C:\Program Files (x86)\Dynamsoft\{Version number}\Images\AllSupportedBarcodeTypes.tif", "");
reader.Dispose();
Decode barcodes from an image file in memory.
TextResult[] Dynamsoft.Barcode.BarcodeReader.DecodeFileInMemory(byte[] fileStream, string templateName)
[in] fileStream
<byte[]> : The image file bytes in memory.
[in] templateName
<string> : The template name.
All barcode text results decoded successfully.
BarcodeReaderException
The exception thrown by Dynamsoft Barcode Reader.
BarcodeReader reader = new BarcodeReader();
reader.ProductKeys = "t0260NwAAAHV***************";
byte[] fileStream = GetFileStream(@"C:\Program Files (x86)\Dynamsoft\{Version number}\Images\AllSupportedBarcodeTypes.tif");
TextResult[] result = reader.DecodeFileInMemory(fileStream, "");
reader.Dispose();
Decode barcodes from the memory buffer containing image pixels in defined format.
TextResult[] Dynamsoft.Barcode.BarcodeReader.DecodeBuffer(byte[] buffer, int width, int height, int stride, EnumImagePixelFormat imagePixelFormat, string templateName)
[in] buffer
<byte[]> : The array of bytes which contain the image data.
[in] width
<int> : The width of the image in pixels.
[in] height
<int> : The height of the image in pixels.
[in] stride
<int> : The stride of the image (also called scan width).
[in] imagePixelFormat
<EnumImagePixelFormat> : The image pixel format used in the image byte array.
[in] templateName
<string> : The template name.
All barcode text results decoded successfully.
BarcodeReaderException
The exception thrown by Dynamsoft Barcode Reader.
BarcodeReader reader = new BarcodeReader();
reader.ProductKeys = "t0260NwAAAHV***************";
Bitmap bBMP = new Bitmap(@"C:\Program Files (x86)\Dynamsoft\{Version number}\Images\AllSupportedBarcodeTypes.tif");
BitmapData bmdat = bBMP.LockBits(new Rectangle(Point.Empty, bBMP.Size), ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb);
int width = bBMP.Width;
int height = bBMP.Height;
int stride = bmdat.Stride;
byte[] buffer = new byte[stride * bmdat.Height];
Marshal.Copy(bmdat.Scan0, buffer, 0, buffer.Length);
bBMP.UnlockBits(bmdat);
EnumImagePixelFormat imagePixelFormat = EnumImagePixelFormat.IPF_ARGB_8888;
TextResult[] result = reader.DecodeBuffer(buffer, width, height, stride, imagePixelFormat, "");
reader.Dispose();
Decode barcode from an image file encoded as a base64 string.
TextResult[] Dynamsoft.Barcode.BarcodeReader.DecodeBase64String(string base64, string templateName)
[in] base64
<string> : A base64 encoded string that represents an image.
[in] templateName
<string> : The template name.
All barcode text results decoded successfully.
BarcodeReaderException
The exception thrown by Dynamsoft Barcode Reader.
BarcodeReader reader = new BarcodeReader();
reader.ProductKeys = "t0260NwAAAHV***************";
byte[] byteFileStream = GetFileStream(@"C:\Program Files (x86)\Dynamsoft\{Version number}\Images\AllSupportedBarcodeTypes.tif");
string base64String = GetFileBase64String(byteFileStream);
TextResult[] result = reader.DecodeBase64String(base64String, "");
reader.Dispose();
Decodes barcode from a bitmap.
TextResult[] Dynamsoft.Barcode.BarcodeReader.DecodeBitmap(Bitmap bitMap, string templateName)
[in] bitMap
<Bitmap> : The image to be decoded.
[in] templateName
<string> : The template name.
All barcode text results decoded successfully.
BarcodeReaderException
The exception thrown by Dynamsoft Barcode Reader.
BarcodeReader reader = new BarcodeReader();
reader.ProductKeys = "t0260NwAAAHV***************";
Bitmap bBMP = new Bitmap(@"C:\Program Files (x86)\Dynamsoft\{Version number}\Images\AllSupportedBarcodeTypes.tif");
TextResult[] result = reader.DecodeBitmap(bBMP, "");
reader.Dispose();
version 7.6.0