To simplify the code here is another example, that display the same
messed-up image:
As a note, BmpSize is giving back a good size.
And WinDrawBitMap ( pBmp .... ) does draw a good image.

Any help would really be appreciated..

thanks!
bill


    UInt32 cbMem = BmpSize( pBmp );

    Err err = errNone;
    err = DmCreateDatabase( 0, "tcBitmaps", 'town', 'cach', false );
    LocalID idDbCache = DmFindDatabase( 0, "tcBitmaps" );
    DmOpenRef rDbCache = DmOpenDatabase( 0, idDbCache, dmModeReadWrite );

    MemHandle hRecBmp = NULL;
    MemPtr  pRecBmp = NULL;

    hRecBmp = DmNewHandle( rDbCache, cbMem );
    pRecBmp = MemHandleLock( hRecBmp );
    err = DmWrite( pRecBmp, 0, pBmp, cbMem );
    MemHandleUnlock( hRecBmp );

    BitmapPtr bitmap = NULL;
    bitmap = (BitmapPtr)MemHandleLock( hRecBmp );

     if( uiLibRef )
          HRWinDrawBitmap( uiLibRef, bitmap, x, y + curheight / uiDivisor );
     else
          WinDrawBitmap( bitmap, x, y + curheight / uiDivisor );

    MemHandleUnlock( hRecBmp );

    err = DmCloseDatabase( rDbCache );
    err = DmDeleteDatabase( 0, idDbCache );


"Ben Combee" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> At 02:29 PM 1/29/2004, Fruber Malcome wrote:
> >The bitmap is a pointer to bitmap data that was generated from our jpeg
lib.
> >
> >Do you see anything that I may be doing wrong here?
>
> You aren't using the BmpGlue functions to determine the size of the
> bitmap.  You may be copying the right number of bytes for the actual
bitmap
> data, but you're missing the bytes needed for the bitmap header.
>
> -- 
> Ben Combee <[EMAIL PROTECTED]>
> CodeWarrior for Palm OS technical lead
> Palm OS programming help @ www.palmoswerks.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