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: Drawing into a HIImageView




On 03.08.2007, at 14:17, Ueli Peter wrote:


Am 02.08.2007 um 15:15 wrote Uli Kusterer:
That's how kEventControlDraw is supposed to work. It redraws the view whenever it needs redrawing. What you really want to do is create a CGBitmapContext, draw into that, and then create a CGImageRef from that which the HIImageView will draw. Or just do your *complete* drawing in a custom view's kEventControlDraw.

What I want to do is to draw directly (no buffering, no cgbitmapcontext) into a hiview, but I don't want the old things I drawed in to be erased (otherwise I had to build a history of my drawings which would make it very slow). Is there a possibility to do that?

Whenever your window is resized, its backbuffer has to be recreated. So unless you use a CGBitmapContext, there is no buffer that you can rely on being there.


 So, I guess you have to use a bitmap context or CGImage.

You can use HIViewSetNeedsDisplayInRect() to mark only part of the view as needing redraw, and check the event parameters to only copy over this area of your CGBitmapContext.

Cheers,
-- M. Uli Kusterer
"The Witnesses of TeachText are everywhere..."


_______________________________________________ Do not post admin requests to the list. They will be ignored. Carbon-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden
References: 
 >Drawing into a HIImageView (From: "Peter Ueli" <email@hidden>)
 >Re: Drawing into a HIImageView (From: Uli Kusterer <email@hidden>)
 >Re: Drawing into a HIImageView (From: Ueli Peter <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.