• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
IKImageView (Again )
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

IKImageView (Again )


  • Subject: IKImageView (Again )
  • From: Christian Graus <email@hidden>
  • Date: Wed, 18 Feb 2009 17:18:56 +1100

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@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

  • Prev by Date: Re: Adding Multiple NSWindow or NSPanel into another NSWindow
  • Next by Date: Moving oneself to /Applications (or ~/Applications)
  • Previous by thread: Re: Is there a known bug in NSUrl?
  • Next by thread: Moving oneself to /Applications (or ~/Applications)
  • Index(es):
    • Date
    • Thread