bitmap data with LoadImage 
Author Message
 bitmap data with LoadImage

I am using the following code to load a bitmap into memory...
    hBmp = LoadImage(0, "test.bmp", IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE)

...once it is loaded, I do some manipulation of it and then I need to feed
it into an activeX control as a byte array buffer.
How do I retrieve the bitmap headers from an hBmp, that I will need later to
reconstruct the bitmap buffer?
I can get the bitmap data with GetBitmapBits, but how do I get the headers?
thanks for any help.



Fri, 04 Feb 2005 21:49:45 GMT  
 bitmap data with LoadImage
Hi, DB

Could you provide a general description of what your are trying to do?  Are
you doing this in a memory DC to get ready for an internet download of the
data as a byte stream?  If so, there are ways to do this that will save you
a lot of time.  Take a look at Q175261 and see if it will meet your needs.  
Here is a link:

http://support.microsoft.com/default.aspx?scid=kb;[LN];Q175261

HTH,

John Eikanger
Microsoft Visual Basic Team

This posting is provided AS IS with no warranties, and confers no rights.
(c) 2002 Microsoft Corporation.  All rights reserved.
--------------------

| Newsgroups: microsoft.public.vb.winapi.graphics
| Subject: bitmap data with LoadImage
| Date: Mon, 19 Aug 2002 09:49:45 -0400
| Organization: Posted via Supernews, http://www.supernews.com

| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 5.50.4522.1200
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200

| Lines: 11
| Path:
cpmsftngxa07!tkmsftngp01!cppssbbsa01.microsoft.com!news-out.cwix.com!newsfee
d.cwix.com!bloom-beacon.mit.edu!newsswitch.lcs.mit.edu!logbridge.uoregon.edu
!tethys.csu.net!nntp!sn-xit-05!sn-xit-06!sn-post-01!supernews.com!corp.super
news.com!not-for-mail
| Xref: cpmsftngxa07 microsoft.public.vb.winapi.graphics:23838
| X-Tomcat-NG: microsoft.public.vb.winapi.graphics
|
| I am using the following code to load a bitmap into memory...
|     hBmp = LoadImage(0, "test.bmp", IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE)
|
| ...once it is loaded, I do some manipulation of it and then I need to feed
| it into an activeX control as a byte array buffer.
| How do I retrieve the bitmap headers from an hBmp, that I will need later
to
| reconstruct the bitmap buffer?
| I can get the bitmap data with GetBitmapBits, but how do I get the
headers?
| thanks for any help.
|
|
|



Sat, 05 Feb 2005 07:13:11 GMT  
 bitmap data with LoadImage


Quote:
>I am using the following code to load a bitmap into memory...
>    hBmp = LoadImage(0, "test.bmp", IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE)

>...once it is loaded, I do some manipulation of it and then I need to feed
>it into an activeX control as a byte array buffer.
>How do I retrieve the bitmap headers from an hBmp, that I will need later to
>reconstruct the bitmap buffer?
>I can get the bitmap data with GetBitmapBits, but how do I get the headers?
>thanks for any help.

Presuming you mean .bmp file headers then if you're only modifying pixel
values the headers are the same as that for test.bmp, but using
LoadImage as above the image has the bitdepth of the desktop and
"modern" cards use 32 bit for TrueColor display i.e. for any .bmp you
load hBmp can be the handle to a 32 bit bitmap. To load at the original
bitdepth you specify the flags as LR_LOADFROMFILE Or LR_CREATEDIBSECTION

--
Richard Mason



Sat, 05 Feb 2005 07:46:37 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Binary Data in SQL 2000/Conver to Bitmap Data For Data Grid View

2. Loadimage API

3. LoadImage from DLL into iPictureDisp

4. LoadImage from DLL into iPictureDisp

5. LoadImage very slow

6. ?Any API quicker than LoadImage?

7. LoadImage Using Shell32.dll

8. LoadImage (NT 4.0)

9. LoadImage API

10. Using LoadImage or LoadIcon APIs?

11. LoadImage

12. LoadImage Constants

 

 
Powered by phpBB® Forum Software