1

I need help to convert my code from C# to VB.NET. I'm stuck on these lines:

byte* ptr = (byte*)(void*)bitmapData.Scan0;
byte* ptr2 = (byte*)(void*)bitmapData2.Scan0;

Here is my full code.

Lance U. Matthews
  • 15,725
  • 6
  • 48
  • 68
  • 1
    If there is a legitimate need for pointers, this code can't be converted directly to VB. There aren't many things that are impossible in VB, but true pointers in unsafe code are one area that can't be done. – Craig Jan 20 '22 at 19:24
  • 1
    You don't need pointers to access the Bitmap Data Bytes. You can use `Marshal.Copy()` to copy the unmanaged data to a managed buffer. VB.Net example [here](https://stackoverflow.com/a/59102380/7444103) – Jimi Jan 20 '22 at 19:33

0 Answers0