Hello, I am completely novice at marshalling, managed/unmanaged concerns, etc. I have a camera SDK that is giving me data in a format
Public BitmapData() As Byte
And I want to plug it into my Bitmap constructor of
Public Sub New ( _
width As Integer, _
height As Integer, _
stride As Integer, _
format As PixelFormat, _
scan0 As IntPtr _
I'm sure I have the correct width, height, format, etc, but can;t seem to plug my BitmapData into the IntPtr. I get an error.
"Value of type '1-dimensional array of Byte' cannot be converted to 'System.IntPtr'."
Does anyone know how to fit this round peg into the square hole?
In C# they do it like this:
fixed (byte* ptr = pBmp)
image = new Bitmap(frame.Width / frame.SubSampleX, frame.Height / frame.SubSampleY, 3 * frame.Width / frame.SubSampleX, PixelFormat.Format24bppRgb, (IntPtr)ptr);
But I don't think I can do that in VB.NET. Any thoughts? Thanks.