save a bitmap given its handle 
Author Message
 save a bitmap given its handle

Can anyone tell me a simple way of saving a bitmap to a
file given a handle to it. Preferably in VB but C++ if I
must go there is OK. I just want to resize a monochrome
bitmap on file
and keep the black bits. I have gone through API functions
but no SaveBitMap function as there is a LoadImage
function.
Any help appreciated.


Sat, 22 Jan 2005 06:38:32 GMT  
 save a bitmap given its handle

Quote:
> Can anyone tell me a simple way of saving a bitmap to a
> file given a handle to it. Preferably in VB but C++ if I
> must go there is OK. I just want to resize a monochrome
> bitmap on file
> and keep the black bits. I have gone through API functions
> but no SaveBitMap function as there is a LoadImage
> function.

Have a look at the Bitmap and DIB tutorials on my site, the former will show
you how to read/write the bitmap at whatever bit-depth you require and the
latter shows you how to go from a Bitmap handle (Selected into a DC) to the
file.
Hope this helps,

    Mike

 -- EDais --

 - Microsoft Visual Basic MVP -
WWW: Http://EDais.earlsoft.co.uk/




Mon, 04 Apr 2005 00:03:35 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. How to extract a bitmap given a file name and bitmap resource ID

2. How to extract a bitmap given a file name and bitmap resource ID

3. Getting a bitmap handle from an icon handle

4. Save record at a given place with given criteria

5. bitmap.fromfile() or bitmap.save() bug

6. retrieve icon bitmap given a file extension

7. Printing a bitmap given the path

8. draw bitmap on picturebox given bitmapinfoheader

9. HowTo kill a window given its handle

10. PDS 7.1 FreeFile gives invalid handle.

11. Given a process handle, enumerate threads

12. Give controls a selected aspect with handle.

 

 
Powered by phpBB® Forum Software