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: Alpha for Carbon window...



I *think* that you can directly access the pixels through the GWorld's baseAddress then. If that doesn't work then you can set up the the pixel image in your own pixel buffer and create a CGImage from that pixel buffer then use Quartz to draw that image into your window.

I'm currently doing all my drawing into an offscreen gworld, then copybitsing into the window on updates/draws. No alpha involved.

Seems to me that I need only to change my window from an old style window, to a new overlay window, do my offscreen drawing, then set the alpha of my gworld, and then use copybits (or CGImage) to copy the full argb pixels to the window/CGContext.

Will that work?

I don't think so. CopyBits would be "using QuickDraw to touch the pixels" and I think it will change the alpha values to 255 for you. (it's very "helpful" that way).

Instead what you can do is create a CGImage directly off of your offscreen GWorld using GetPixBaseAddr and GetPixRowBytes and such to fill in the fields of CGCreateImage. Once you have done that you can blit the image into the window's context using CGContextDrawImage.

--
Macintosh Software Engineering Contractor for Hire
Resume available at <http://homepage.mac.com/easco/RSTResume.html>
_______________________________________________
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: 
 >Alpha for Carbon window... (From: Ando Sonenblick <email@hidden>)
 >Re: Alpha for Carbon window... (From: Ricky Sharp <email@hidden>)
 >Re: Alpha for Carbon window... (From: Scott Thompson <email@hidden>)
 >Re: Alpha for Carbon window... (From: Ando Sonenblick <email@hidden>)
 >Re: Alpha for Carbon window... (From: Scott Thompson <email@hidden>)
 >Re: Alpha for Carbon window... (From: Ando Sonenblick <email@hidden>)
 >Re: Alpha for Carbon window... (From: Scott Thompson <email@hidden>)
 >Re: Alpha for Carbon window... (From: Ando Sonenblick <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.