| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
On May 12, 2005, at 6:08 PM, Steve Mills wrote:
You shouldn't be casting a CGBitmapContextRef to a CGImageRef. The two are completely different objects. What the docs are probably trying to imply is that you can create a block of memory to hold a pixel buffer. You can then draw in that pixel buffer using a CGBitmapContextRef. Once you have finished drawing, you can create a CGImageRef from the same pixel buffer and draw the pixels using CGContextDrawImage. Using this technique, you could draw the common parts of your ruler in an offscreen bitmap and then create a CGImage for that bitmap. Whenever you wanted to draw those pixels again... you sijply draw the image.
Well... using HIThemeDrawTextBox may not be the best choice. You might get better performance using ATSUI directly. However, I can't imagine that you are going to come up with a ruler based on simple lines that is going to tax Quartz 2D. Particularly if you use CGContextAddLines effectively. Still, if it would make you feel better to cache some things off, you can do so using the technique I mentioned above. You could also record the drawings into a PDF in memory and replay that PDF every time you wanted to draw the ruler.
Scott |
_______________________________________________ Do not post admin requests to the list. They will be ignored. Quartz-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/quartz-dev/email@hidden This email sent to email@hidden
| References: | |
| >cache or draw direct? (From: "Steve Mills" <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
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.