You can always call LockBits and get a pointer to memory. You could implement your own SetBitmapBits this way and it would be pretty fast (as opposed to using the GDI+ GetPixel/SetPixel API which is slow as a dog.)
Several options: you can call LockBits(), as BigEd781 said, and then use one of the Copy() method overloads of the Marshal class, to copy the data to a managed byte array (as shown in the example here); next, i think you can mess with pointers in a so-called unsafe block, and work on the data directly; and finally, you can P/Invoke SetBitmapBits(), or better, P/Invoke SetDIBits().
Last edited by TheGreatCthulhu; July 22nd, 2011 at 07:53 PM.
Sorry, I just glanced over it, and I didn't even see the last few words...
Well, in that case - go for the either one of the first two options. I only tried the approach based on the Marshal.Copy() method, and it seems that it's generally OK; the pointer based approach should be faster.
Originally Posted by HanneSThEGreaT
I think I may have understood the question. [...] Sorry if I did