Re: Example needed to show how to overlay images upon a single view
Re: Example needed to show how to overlay images upon a single view
- Subject: Re: Example needed to show how to overlay images upon a single view
- From: Shawn Erickson <email@hidden>
- Date: Wed, 12 Jan 2005 09:49:34 -0800
On Jan 12, 2005, at 9:33 AM, Frederick C. Lee wrote:
Thanks for the response!
I don't want to draw onto the background image, but to place an
'overlay' or a virtual 'plastic' layer to draw upon and maneuver.
That way, I can customize the collection without changing the parts.
I want to be able keep each layer independent and modifiable.
An example would be a weather map: You can draw/erase weather symbols
upon the map of the U.S., without actually affecting the map itself.
Each layer would have its own data storage.
I'll play with your idea to see if that is what I can do.
I was thinking that it would be necessary to stack NSImageViews and
work with each separately; since each NSImageView works with one (1)
image. Perhaps this takes too much overhead. I don't know.
Yeah don't use NSImageViews for this. NSImageViews are more about being
a control that users can drop image files on then a way to display
images. Implement a custom NSView sub-class that does the compositing
of images as needed.
Whatever you do make sure to understand how you display your data
should be separate from how you manage your data (MVC). Just because at
display time you composite images to a single view doesn't mean that
those images cannot be the visualization of separate independent
objects or respond as objects. It also doesn't require you to modify,
based on your example, the background image... you simply composite
over it (Quartz2D & Cocoa uses what many call the painters model, you
should get comfortable with how it works).
Of course you could go so far as to implement your own control
sub-classes to provide your object hit testing, etc.
Look over the sample code that exists on your system (or online)...
Likely: <file:///Developer/Examples/AppKit/Sketch>
-Shawn
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden