Announcements and discussion for PInvoke


Postby dotnetfl » Fri Nov 13, 2009 3:42 am

I cannot figure out how to marshal a CBitmap to a Bitmap or Image class.

My import looks like this:

[DllImport(@"test.dll", CharSet = CharSet.Unicode)]
public static extern IntPtr GetBitmap(System.IntPtr hwnd, int nBMPWIDTH, int nBMPHEIGHT);

The H file section looks like:

Cbitmap* GetBitmap(HWND hwnd,int nBMPWIDTH,int nBMPHEIGHT);

How do I go about converting the Cbitmap into something I can display in C#?

Many thanks.
Posts: 1
Joined: Fri Nov 13, 2009 3:38 am

Return to PInvoke.Net

Who is online

Users browsing this forum: No registered users and 0 guests