🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.nativeapi
4 messages
4 total messages Started by Buster Wed, 07 May 2003 01:40
Resource file format for RT_BITMAP
#16555
Author: Buster
Date: Wed, 07 May 2003 01:40
23 lines
1649 bytes
I want to put a bitmap in the resources of my .exe file, so that I can
load it using FindResource (with an lpType parameter of RT_BITMAP) and
LoadResource. To do this I'll be using UpdateResource:

BOOL UpdateResource(
  HANDLE hUpdate, // update-file handle
  LPCTSTR lpType, // resource type
  LPCTSTR lpName, // resource name
  WORD wLanguage, // language identifier
  LPVOID lpData,  // resource data
  DWORD cbData    // length of resource data
);

What format should the resource data pointed to by lpData be in?

Apparently this is a completely bizzare thing to want to do, as the
Microsoft docs give no clue, as far as I can see. (The page on
resource file formats gives details on pretty much everything except
bitmaps.)

Thanks for reading

Buster
Re: Resource file format for RT_BITMAP
#16560
Author: Vladimir Afanasyev
Date: Wed, 07 May 2003 07:41
12 lines
1210 bytes
Hi,

May be it is a little outdated information but it seems 
explain BMP resource:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwui/html/msdn_hierlist.asp


http://support.microsoft.com/default.aspx?scid=kb%3ben-us%3b67883

Vladimir.
Re: Resource file format for RT_BITMAP
#16563
Author: Buster
Date: Wed, 07 May 2003 10:47
15 lines
1332 bytes
> Hi,
>
> May be it is a little outdated information but it seems
> explain BMP resource:
>
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwui
/html/msdn_hierlist.asp
>
>
> http://support.microsoft.com/default.aspx?scid=kb%3ben-us%3b67883
>
> Vladimir.

Thank you! I'll check it out.
Re:[SOLVED] Resource file format for RT_BITMAP
#16565
Author: Buster
Date: Wed, 07 May 2003 13:29
34 lines
2367 bytes
> Hi,
>
> May be it is a little outdated information but it seems
> explain BMP resource:
>
> http://support.microsoft.com/default.aspx?scid=kb%3ben-us%3b67883
>
> Vladimir.

Thanks Vlad. Your link contained the very useful
"NOTE: The BITMAPFILEHEADER structure is NOT present in the packed
DIB; however, it is present in a DIB read from disk".

Combining this with (from "Bitmap Storage" in the Platform SDK docs:
not in the index, and ranked 20th in a search for "bitmap storage"):
"Bitmaps should be saved in a file that uses the established bitmap
file format and assigned a name with the three-character .bmp
extension. The established bitmap file format consists of a
BITMAPFILEHEADER structure followed by a BITMAPINFOHEADER,
BITMAPV4HEADER, or BITMAPV5HEADER structure. An array of RGBQUAD
structures (also called a color table) follows the bitmap information
header structure. The color table is followed by a second array of
indexes into the color table (the actual bitmap data)."

and (for example, from the description of the lbHatch field in the
LOGPALLETE struct)

"A packed DIB consists of a BITMAPINFO structure immediately followed
by the array of bytes that define the pixels of the bitmap.",

as soon as I guessed that an RT_BITMAP resource is just a packed DIB I
was away. Literally hours of fun, and all thanks to MS!

Buster
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads