Thank you very much. I didn't know if the locked handle from GetResource
was JUST a BitmapType , or if it might have included other items...
Steve
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Richard
Hartman
Sent: Tuesday, June 13, 2000 4:55 PM
To: Palm Developer Forum
Subject: Re: Format for bitmap resources?
You don't need to know the format to draw it:
VoidHand h = NULL;
BitmapPtr pBitmap = NULL;
SWord xpos = 10, ypos = 10; // default to up/left corner
file://- (bitmap) resource type
// note: there may be more than one tAIB resource
// w/ the same resid. In the Constructor 1.x terms,
// a "multibit icon" or a plain old "icon" both turn
// into tAIB resources, but w/ different properties
// about the bit depth. The OS gives you the one
// w/ the most bit depth when you ask for it.
if (!h)
h = DmGetResource( 'tAIB', resid );
file://- if we don't have it, we can't draw it!
if (!h)
return false;
file://- lock & load!
pBitmap = (BitmapPtr) MemHandleLock( h );
file://- some sort of problem locking it down, oops
if (!pBitmap) {
DmReleaseResource(h);
return false;
}
file://- draw it
WinDrawBitmap(pBitmap, xpos, ypos);
file://- clean up
MemHandleUnlock(h);
DmReleaseResource(h);
--
-Richard M. Hartman
[EMAIL PROTECTED]
186,000 mi/sec: not just a good idea, it's the LAW!
Steve Austin wrote in message <14219@palm-dev-forum>...
>
>I tried to find this in the knowledge base, but since its still
unavailable,
>
>Does anyone know the format of a bitmap resource? All I want to do is to
be
>able to open a bitmap resource and draw the bitmap to the screen (without
>the use of a form bitmap).
>
> I took a look through the pilrc code and came up with something....the
>pilrc code is a bit hard to read though and I don't think this is actually
>what I want.
>
>unsigned short bfType ?
>unsigned long size
>unsigned short reserved1
>unsigned short reserved2
>unsigned long bfOffbits ?
>bitmap bits ....
>
>Am I looking at the wrong code?
>
>Thanks,
>
>Steve
>
>
>
--
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/tech/support/forums/
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/