Hi All!

Ralf Beckers wrote:
> I need to include a 256 Byte long binary data ressource with CW (i'm
> running it on a windows machine).

I already have an solution ;-)

For those who are interessted in the solution:

I created a Bitmap ressource with a specific size (64*32 Pix in my case
for 256 Byte).

Then search the binary for 
Tbmp[IDNum]
if Bitmap Id is 2100 search for

54 62 6D 70 08 34 (hex! last 2 Byte are the ID)
T  b  m  p  [ID ]

then a 4 Byte offset in the binery file follows. This is the bitmap.

Add 16 Bytes (0x10) to this Offset (this is the header size of this
bitmapressource).
now you have the raw bitmap data.

You can obtain it programmatically through

        VoidHand bitmapH;
        BytePtr bitmapP;
        BytePtr padPtr;

        padPtr = MemPtrNew(sizeYouNeed);        
        bitmapH = DmGetResource (bitmapRsc, infoBitmap);
        bitmapP = MemHandleLock(bitmapH);
                
        MemMove(padPtr, (BytePtr)(bitmapP+0x10), sizeYouNeed);

Btw.: Is there a description to the binary format of an prc?
Using oldfashioned, dos-based hexeditors and calcs sucks, if you haven't
got the time ;-)

bexxx

Reply via email to