Ok... this is what I've come up with... after LOADS of hours...
I converted the code from the realworldasp-link from VB to C#
however in order to pass the compilation I had to change the following:
win32api win32 = new win32api();
win32.CopyArrayTo(pBits, bits, Height * stride);
//win32api win32 = new win32api();
win32api.CopyArrayTo(pBits, bits, Height * stride);
this because I get a error message:
"Static member 'myProject.win32api.CopyArrayTo(int, byte, int)' cannot be accessed with an instance reference; qualify it with a type name instead"
This is why I have to chanhe it. I am now wondering (except for the obvious why...) what the risks/limitations with this might be by doing it this way.
I am not good at .NET arcitecture, but it seems to me like a stupid thing to do... can anyone explain to me what I'm doing?
by the way... the win32api declaration looks like this:
public class win32api
[DllImport("KERNEL32.DLL", EntryPoint="RtlMoveMemory", SetLastError=true, CharSet=CharSet.Auto, ExactSpelling=true, CallingConvention=CallingConvention.StdCall)]
public static extern void CopyArrayTo([In, MarshalAs(UnmanagedType.I4)] Int32 hpvDest, [In, Out] byte hpvSource, int cbCopy);