BitBlt in C# under .NET CF

--Merciless--

New member
Joined
Oct 7, 2003
Messages
2
Hi all,

I was just wondering if anyone had any pointers to using the BitBlt API from C# using the .net compact framework? Ive got the declaration (its in coredll.dll) but the CF doesnt expose methods for obtaining the hDC from a graphics object.

Im currently using the DrawImage method but its a little slow, and Id like to try BitBlt for comparison. Anyone out there tried this?

Cheers,
--Merciless--
 
BitBlt is faster than DrawImage but DrawImage supports more features. You can reduce the lag by the way you use DrawImage, if you only draw when you have to then you can save speed, but if youre looping or something it will be very slow

I dont know how to get a DC on the compact framework if the Graphics class doesnt expose the method. Is the GetDC and ReleaseDC APIs there?
 
Thanks for replying! I do want speed - Im blitting some tiles and a background (up to ~280 operations) and all I need is masking and painting (SRCAND & SRCPAINT) - just what BitBlt is good at!

Im using DrawImage with an ImageAttribute object to get transparancy, and my routine is about as optimised as Im going to get it for speed without BitBlt.

Sadly, the .net CF doesnt have the GetDC and ReleaseDC methods on a graphics object. I did think about using pictureboxes and getting their hWnd (which is supported), and then using the GetDC API on this, but it just seemed to produce garbage (unlike the same approach in VB6). (Yes, I know VB6 exposes the hDC of a picturebox, but the GetDC function still works fine!)

Cheers for the interest,
--Merciless--
 
Back
Top