Re: Displaying an offset image. (SOLVED)
Re: Displaying an offset image. (SOLVED)
- Subject: Re: Displaying an offset image. (SOLVED)
- From: Mac First <email@hidden>
- Date: Thu, 11 Jun 2009 18:02:58 -0700
Sheesh! I'm sorry -- I guess I just need to learn to read.
---
"Translates the receiver’s coordinate system so that its origin moves
to a new location.
[I stopped reading here and got confused. The Discussion section
explains all.]
- (void)translateOriginToPoint:(NSPoint)newOrigin
Parameters newOrigin
A point that specifies the new origin.
Discussion
In the process, the origin of the receiver’s bounds rectangle is
shifted by (–newOrigin.x, –newOrigin.y). This method neither
redisplays the receiver nor marks it as needing display. You must do
this yourself with display or setNeedsDisplay:.
Note the difference between this method and setting the bounds origin.
Translation effectively moves the image inside the bounds rectangle,
while setting the bounds origin effectively moves the rectangle over
the image. The two are in a sense inverse, although translation is
cumulative, and setting the bounds origin is absolute."
---
The working code is:
NSRect iviewBounds = imageView.bounds;
iviewBounds.origin.x = xStart;
iviewBounds.origin.y = yStart;
[imageView setBounds:iviewBounds];
My apologies for the spam to list. Hopefully, this will help some
future archive spelunker.
--
When you scold a dog for chewing your sofa, he's sorry he chewed your
sofa. When you scold a wolf for chewing your sofa, he's sorry you
have such an unhealthy attachment to your sofa.
_______________________________________________
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