Due to the dramatically different memory models in .NET and unmanaged raw Windows API, I would not recommend you doing it, as you would need to work with Windows bitmaps from the very beginning and may have a lot of problems.
You could use the class
System.Drawing.Bitmap
with
System.Drawing.Bitmap.LockBits
to do the same thing.
Find the code sample here:
http://msdn.microsoft.com/en-us/library/5ey6h79d.aspx[
^].
Alternatively, you could use WPF and
System.Windows.Media.Imaging.WriteableBitmap
.
You will find a code sample here:
http://msdn.microsoft.com/en-us/library/system.windows.media.imaging.writeablebitmap.aspx[
^].
—SA