Logan Shaw wrote:

Anyway, I would run the code through the debugger, then look at
the "flags" field of the BitmapType and see if it has the "indirect"
flag set.  You might also check BmpSize() to make sure it's
reasonable for the size of the pixel data you have.  (For example,
if your bitmap is 100x100 and 16 bits per pixel, then you should
have 20000 bytes of pixel data plus some overhead for headers
and stuff.)

  - Logan


Hi Logan,

Thanks for the reply,

I'm trying know to write the header and data stuff separated by using 3
dmwrite: one for header, other for data and the last for indirect bit:

After some research I got something like:

        //write header:
        err = DmWrite (pRecBmp,
                           0,
                           srcP,
                           headerSize );
                                
        //write data:
        err = DmWrite (pRecBmp,
                        headerSize,
                        BmpGetBits( (BitmapPtr) srcP),
                        dataSize );

                                
        //write indirect bit
        UInt8 uIndirect = 4;

        err = DmWrite(  pRecBmp,
                        6,
                        &uIndirect,
                        1 );



But the stored handle still give me a corrupted bitmap with the -258x-258 dimension problem persisting - maybe a corrupted header?
Any idea?

Also I see some examples creating a offscreen window and copying the bitmap data to the offscreen window right before writing it. Do I need to do that? I am not doing it due my bitmap is already in dynamic heap before write it.

thanks

Erico Franco



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

Reply via email to