Knowledge Base

The leading provider of version control solutions and TWAIN SDKs

Use DecodeBuffer/DecodeBufferEx in different use cases

If you are trying to read barcodes from video stream directly, then DecodeBuffer/DecodeBufferEx method is the right one for you.

This article will explain each parameter of this method and provide some code snippet to guide you through how to use it.

The first parameter is a byte matrix. Each byte has the value from 0 to 255 and represents one image pixel. 0 means a black pixel and 255 means a white pixel. Pixels are placed from the left to the right, from top to bottom, row by row.

The matrix is passed to the Decode method as a one-dimensional array. The first upper line of the image is sent first, then comes the second line and so on (as shown in the following illustration).
When an image is stored in memory, the memory buffer might contain extra padding bytes after each row of pixels. The padding bytes affect how the image is stored in memory, but do not affect how the image is displayed.

The stride is the number of bytes from one row of pixels in memory to the next row of pixels in memory. If padding bytes are present, the stride is wider than the width of the image, see the image below for explanation. Please kindly note that you need to calculate it based on the video format.

Article Details

Last Updated
22nd of January, 2019

Would you like to...

Print this page Print this page

Email this page Email this page

Post a comment Post a comment

Subscribe me

Add to favorites Add to favorites

Remove Highlighting Remove Highlighting

Edit this Article

Quick Edit

Export to PDF

User Opinions (0 votes)

No users have voted.

How would you rate this answer?

Thank you for rating this answer.

Related Articles

No related articles were found.


No attachments were found.