Werner Pretorius
asked on
How to save a image using imagedata (C++ sample to vb.net)
I have a sample application written in C++ for a slap scanner. I am able to get the image scanned but do not know what to do with the data received. Can anybody guide me in the right direction?
I have attached the SaveImage Code from the sample app(Written in C++) and would like to know how convert it to vb.net. I am novice when it comes to C++.
I have tried to read the bytes from memory starting at the pointer returned to the tagImageData structure during the scanning process.
here is the structure that contains the image data:
<StructLayout(LayoutKind.S equential, CharSet:=CharSet.Unicode)> Public Structure tagImageData
Public Buffer As IntPtr '< Pointer to image buffer
Public Width As UInteger '< Image horizontal size
Public Height As UInteger '< Image vertical size
Public ResolutionX As Double '< Horizontal image resolution (in PPI)
Public ResolutionY As Double '< Vertical image resolution (in PPI)
Public FrameTime As Double '< Image acquisition time (in seconds)
'< This value contains the time taken for acquisition
'< from device (excluding processing time).
Public Pitch As Integer '< Image line pitch (in Bytes).
' Positive values indicate top down line order,
' Negative values mean bottom up line order
Public BitsPerPixel As Byte '< Number of Bits per pixel
Public Format As Integer '< Image color format
Public IsFinal As Boolean '< Marks image as finally processed
' A value of "FALSE" disqualifies image for further processing.
' (e.g. interim or preprocessed result images)
End Structure
SaveImage.cpp
SaveImage.h
I have attached the SaveImage Code from the sample app(Written in C++) and would like to know how convert it to vb.net. I am novice when it comes to C++.
I have tried to read the bytes from memory starting at the pointer returned to the tagImageData structure during the scanning process.
here is the structure that contains the image data:
<StructLayout(LayoutKind.S
Public Buffer As IntPtr '< Pointer to image buffer
Public Width As UInteger '< Image horizontal size
Public Height As UInteger '< Image vertical size
Public ResolutionX As Double '< Horizontal image resolution (in PPI)
Public ResolutionY As Double '< Vertical image resolution (in PPI)
Public FrameTime As Double '< Image acquisition time (in seconds)
'< This value contains the time taken for acquisition
'< from device (excluding processing time).
Public Pitch As Integer '< Image line pitch (in Bytes).
' Positive values indicate top down line order,
' Negative values mean bottom up line order
Public BitsPerPixel As Byte '< Number of Bits per pixel
Public Format As Integer '< Image color format
Public IsFinal As Boolean '< Marks image as finally processed
' A value of "FALSE" disqualifies image for further processing.
' (e.g. interim or preprocessed result images)
End Structure
SaveImage.cpp
SaveImage.h
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER