Hi there!
I'm writing a program to do some image processing on the GPU. For this I'm using CUDA.Net, but unfortunaly the CUDA doesn't recognize the type byte, in which I was able to store the pixels information using this code:
BitmapData bData = bmp.LockBits(new Rectangle(new Point(), bmp.Size),
ImageLockMode.ReadOnly,
PixelFormat.Format24bppRgb);
// number of bytes in the bitmap
byteCount = bData.Stride * (bmp.Height);
byte[] bmpBytes = new byte[byteCount];
Marshal.Copy(bData.Scan0, bmpBytes, 0, byteCount);
bmp.UnlockBits(bData);
return bmpBytes;
My problem resides in the fact that CUDA doesn't take this byte array, and if change it to a type int[] the program retrieves an AccessViolationException.
Does someone has any thoughts to resolve this problem?
Thanks in advance.