Displaying an offset image.
Displaying an offset image.
- Subject: Displaying an offset image.
- From: Mac First <email@hidden>
- Date: Thu, 11 Jun 2009 17:32:04 -0700
I have a 500x500 image. It's really a 5x5 array of 100x100 image tiles.
I have a 100x100 NSView, imageParentView.
I have a 500x500 NSImageView ("image well" in IB), "imageView" that is
a subview of imageParentView and which holds my image.
I'd like to display the 3rd tile in the 2nd row, so it shows through
imageParentView.
This code...
NSRect iviewFrame = [imageView frame];
iviewFrame.origin.x = 300;
iviewFrame.origin.y = 200;
[imageView setFrame:iviewFrame];
NSLog(@"frame origin: %0.1f, %0.1f", [imageView frame].origin.x,
[imageView frame].origin.y);
...Didn't do what I had hoped. (As far as I can tell, it moves my
parent view off-screen. I'm not 100% sure about that, but the framing-
view -- which I assume is imageParentView -- disappears.)
Am I close? Hints? Is there a tutorial for this?
Thanks!
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden