--- [EMAIL PROTECTED] wrote:
> OK I just upgraded to the 4.1 SDK and am simply trying 
> to display a bimap. I have tried this in the Visor Prism 
> and Palm 4.x ROMS. 
> 
> Here is my code
> 
> UInt32        m_uiMaxWidth = 160;
> UInt32        m_uiMaxHeight = 160; 
> UInt32        m_uiMaxDepth = 8;
> Boolean m_uiEnableColor = 1;
> 
> iErr = WinScreenMode(winScreenModeSet, &m_uiMaxWidth, 
>  &m_uiMaxHeight, &uiDepth, &m_uiEnableColor);

You should check iErr before assuming WinScreenMode worked.

>
> MemHandle resH = DmGetResource (bitmapRsc,LogoBitmap);
> if(resH)
> {
>   BitmapType *bitmap = (BitmapType*)MemHandleLock (resH);
>   WinPaintBitmap(bitmap, 1, 1);

If the bitmap is 160x160, you should draw it at (0,0).

>   MemHandleUnlock (resH);
> }

Where is DmReleaseResource()?

> 
> For simplicity, I force the values in the code above. The 
> prob is when the code reaches
> 
> MemHandle resH = DmGetResource (bitmapRsc,LogoBitmap);
> 
> I get a NULL returned. I have put my bitmaps in a family, 
> one 1 bit black and white, one 8 bit color. 

Are you using the ID of the bitmap family, or are you using the ID of
the 8-bit bitmap?  (You have to use the bitmap family ID).

> I have tried to use the 1.5 and the 1.6.2 constructor. I 
> can't even drop a bitmap control in my form. Blows up in the 
> same way. Am I doing something wrong here?

What is blowing up?  Constructor?  Your code?  If you can't add a Form
Bitmap to a form in Constructor and set its Bitmap Resource to the id
of the bitmap family that is part of the .rsrc you are editing, then
something is probably wrong with your CW installation.


__________________________________________________
Do You Yahoo!?
Yahoo! Games - play chess, backgammon, pool and more
http://games.yahoo.com/

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to