Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Win32 (http://www.go4expert.com/forums/win32/)
-   -   How to get byte array from HBITMAP object in win32 project? (http://www.go4expert.com/forums/byte-array-hbitmap-object-win32-project-t21187/)

varsha123 3Mar2010 15:45

How to get byte array from HBITMAP object in win32 project?
 
Hi,


In win32 DLL project, I want to capture desktop window
into byte array. and display bitmap image using byte array.

For that I have capture window function which returns HBITMAP object.
then I saved this object into bit map file and for display purpose I
load that image.

Now, instead of BMP file I want to store capture data into byte array
and for display bitmap image I want to use byte arrray.

So I want convert HBITMAP object to byte array and byte array to
HBITMAP object.

In MFC activex I used Cbitmap same purpose but in win 32 Cbitmap not
available.

So, How to acheive this in win 32 DLL project.

Thanks & Regards
Varsha

Gene Poole 9Mar2010 19:06

Re: How to get byte array from HBITMAP object in win32 project?
 
CBitmap is just a wrapper for some of the common GDI bitmap routines. You should still be able to call, say, ::GetBitmapBits() to extract a pointer to the byte data that make up the bitmap.


All times are GMT +5.5. The time now is 04:16.