Doug,

> So you BmpCompress() to successfully uncompress a compressed bitmap?

Yes. As I told you, before giving transparency to a bitmap, I needed to uncompress it. 
So, it is doable in NSBasic.
I didn't try in C yet. But, I am sure you will.

> >My pBmpr2 was declared as a Variant (no special structure). In C it would be
> >a void*. (it could be related to sysErrParamErr error).
>
> It's not related to the error.  But to humor us, I did change the definition and
> I still get the same error.

I always verify all possibilities. Even humor ones :)
Thank you for trying mine... I am not ashamed :)
The best thing about learning, is that we finally see how it was possible not seeing 
that before...
An interesting history is the invention of logarithm (it was a revolution with a so 
simple idea).

> Which of course is only due to the lack of constants available.

Certainly...

> >Err = SysTrapFunc(991,2,MemPtrNew,compressType)
>
> You left out the line where you copied the storage heap bitmap to the dynamic
> heap bitmap.  For the lines you quoted, MemPtrNew (a Variant) contains a pointer
> to 64000 bytes but does not contain a valid compressed bitmap -- so you're
> obviously leaving out a line corresponding to my MemMove().

Doug, I really appreciate your cleverness. It is an honour to try to help you, as you 
have helped us in NSBasic Forum.
You are right, again... :)
But, I knew you would get it :>

Here it is the sequence:
DmOpenDatabase
DmFindResourceType
DmGetResourceIndex
MemHandleLock
MemPtr = SysTrapFunc(33,1,MemHandle)
MemHandleUnlock
DmReleaseResource
... Now, MemMove() part...
MemPtrNew
MemMove
BmpCompress
BmpSize
DmResizeResource
DmWrite
DmResizeResource
... That's all folks :)

This complete sequence would allow you make some tests with your 3k bitmaps.

> >But, just taking another look at my own documented code <g>, I see that
> >Version 2 encoding is supported in Palm OS 3.5 and later, but only if
> >High-Density Display Feature Set is present.
>
> No, you're reading that wrong.  Version two encoding is supported from 3.5 on,
> but the *typedef* for BitmapTypeV2 got added later.  You can work with v2
> bitmaps just fine starting with OS 3.5, but the typedef for BitmapTypeV2 and
> BitmapTypeV3 didn't appear on the high-density display feature set was added.

Sorry, I just mixtured things. More caffeine as you say... :)
I was trying to talk about "version" 2 of compressing (BitmapCompressionTypePackBits) 
as it only works (compress and uncompress) on
a PalmOS 4.0 or higher device.
But, at some point I mixed with BitmapTypeV2 considerations. Excuse me.
Anyway, just check this too (remember humor ones?).
PackBits uncompressions shouldn't work in a PalmOS 3.5 device.

> >So, it seems that we should
> >have both features in our devices (early Handspring, probably, or a PalmOS
> >4.0 compatible device). Would be this your problem?.
>
> No.  I've tried the code on both OS5 and OS4 devices, and get identical results.
> I always get sysErrParamErr.

Probably, there is something more we are not seeing...

> It's not so much that I really need this to work -- I can just document "don't
> do that" -- as it is bewilderment on what I am missing.  Per the docs, it seems
> like it should be easy to uncompress a bitmap in the dynamic heap.
> And I don't seem to be the only one having trouble uncompressing them.

Yes. I hope that this new approach (2 years old) described up-lines in this email may 
help someone more.
Of course, it is limited to a final 64k-uncompressed-bitmap.

> Is this a known problem in some OS versions?

I will make some more tests...

Adrian Nicolaiev


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

Reply via email to