Re: [slightly OT] Bitmaps for controls
Re: [slightly OT] Bitmaps for controls
- Subject: Re: [slightly OT] Bitmaps for controls
- From: Alberto Ricci <email@hidden>
- Date: Wed, 16 Oct 2002 14:18:17 +0200
However, my efforts to copy the PixelMap and then dispose the
graphics world results in weird graphics and/or crashes on
subsequent calls to CopyBits.
Yeah, if you dispose of the GWorld your pixmap becomes invalid.
That's because the pixmap simply points to data in your GWorld
storage. By the way, remember to bracket every access to the pixmap's
data with LockPixels() (making sure it returns true) and
UnlockPixels().
And should you end up using Quartz 2D, remember that if you use
CGDataProviderCreateWithData in order to get a CG data provider for
your offscreen world, you need to keep pixels locked and the GWorld
alive throughout the life of the CGDataProviderRef.
There is a big advantage to using Quartz 2D in AudioUnit UIs. If you
have knobs, you can just have a single image for the knob indicator
and then apply a rotation matrix before drawing the knob in a certain
position. And if you want the shadow, simply overlay a black image
with an appropriate alpha channel.
Best,
Alberto.
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.