OK, so I have the following code:

NSPoint endPoint = [self convertPoint:[theEvent locationInWindow] fromView:
self];

 float left = startPoint.x;

float width = endPoint.x - left;

 if (left > endPoint.x)

{

width = -width;

left = endPoint.x;

}

 float top = startPoint.y;

float height = endPoint.y - top;

 if (top > endPoint.y)

{

height = -height;

top = endPoint.y;

}

NSRect rc = NSMakeRect(left, /*[self bounds].size.height -*/ top, width,
height);

// [self zoomImageToFit:self];

 rc = [self convertViewRectToImageRect:rc];

 NSPoint center;

center.x = rc.origin.x + (rc.size.width/2);

center.y = rc.origin.y + (rc.size.height/2);

 [self zoomImageToRect:rc];


Where the start point is stored on click and then this is in the mouse up
event.  I am certain this worked at some point, but now it always zooms to
the bottom left of the image.  I've tried things like:

[self setImageZoomFactor:[self zoomFactor] centerPoint:center];//*/

Which is supposed to recenter the image based on the center of the point I
established, but it always still stays in the bottom left.  Can anyone tell
me how to take the points that I have and use them to zoom an image in an
IKImageView ?

I've even tried to just increase the zoom factor to get SOME sort of zoom
going, but even this scrolls down and left.

Christian
_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to