Mailing Lists: Apple Mailing Lists

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

Drawing into a HIImageView



Hi,
I'm porting a widget toolkit (EiffelVision: https://eiffelsoftware.origo.ethz.ch/Vision4Mac_Documentation) to Carbon. The toolkid has a DrawingArea. This is a widget, where it is possible to draw some lines, circles, squares... in. 

I thought that I can use a hiImageView and draw with Quarz into it. Unfortunately I have some trouble in implementing it. For Quarz drawings, I need a Context. right? In the Quarz2d guide I read that I need a keventcontolDraw Event to get the context. 

The problem is the following: If I want to draw a square into the imageview, I store the coordinates into a global variable and call hiviewsetneedsdisplay to get the controlDraw event. Then in the event handler I get the context with getEventParameters. 
This works fine. But if I want to draw a second square, over the first one. The first one gets lost (because of the redraw of the hiimageview). How can I draw something new into the imageview without losing the old content?

I tried also to store the context reference globaly an then draw to it whenever I wan't to draw to it. But then the drawings are not drawn into the imageview but somwehere else in the window. 

Has anybody some hints how to implement it? Is there a better possbibilty than the one I tried (getting the context from a event). 

Thanks 

Ueli Peter
 _______________________________________________
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



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.