1
Reply

Trading bitmaps between DirectX and GDI+ question

erichood

erichood

Nov 22 2004 9:10 AM
2k
Preface: DirectX has a bitmap object where you can access the data block directly thru a pointer: (DDSURFACEDESC)sd.lpSuface; GDI+ has a bitmap object where you can access the data block directly thru a pointer: (Bitmap)b.Scan0; My question is: Is there a safe way to create a Bitmap object and map its pointer to the DirectX bitmap? Something to the effect that: b.Scan0 = sd.lpSurface; ? It should be possible as long as both bitmap objects point to the same type of data block. But I'd be concerned about memory leaks when changing the pointers. Plus, I'm not fully sure everything that would need to be changed to make it work. Why am I doing this? Generally, I'm using DX7, but it lacks the extremely simple method: Bitmap.Save(...) Any suggestions? TIA, --Eric

Answers (1)