Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to grab IconRef from a .tiff file.



On 21/08/2003 21:33, Laurence Harris wrote:

> Do you know of any way to draw *just* the alpha channel?

I found the way, I just not sure it is the most straightforward way.

> Awsome, Mike! Thanks.
>
> BTW, shouldn't that be LockPixels();
>
> instead of
>
> HLock((Handle)GetGWorldPixMap());

No, this is for a reason. QuickDraw does LockPixels for you
implicitly on every drawing operation, so it is not required.
On the other hand the was still is (as I rechecked it just
yesterday) a bug in QuickDraw that is caused by improper use
of dereferenced unlocked pixmap handle. This bug is still
clearly reproduced on 9 especially in case of picture recording.
I am sure the bug is still there in X, although it doesn't
reproduce itself because handles no longer move on X. So I
always lock pixmap handle with HLock either the next line
after creating GWorld or before CopyBits.

> I tried this and the other problem is that the result is the reverse of what
> it should be. Is there more work involved or does it just need a different
> copy mode than subOver?

First make sure you get expected image when you open it in
Preview app. It might be the case that this is alpha channel
in the image is inverted for some reason. If image is ok but
you still get inverted result, put InvertRect(&r) after CopyBits.

Mike
_______________________________________________
carbon-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/carbon-development
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: How to grab IconRef from a .tiff file. (From: Laurence Harris <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.