• 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
after resizing an image...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

after resizing an image...


  • Subject: after resizing an image...
  • From: Development <email@hidden>
  • Date: Wed, 17 Oct 2007 20:02:10 -0700

All right, In my app you can resize the view of an image. A pretty normal function. However if you resize the view of the NSImage. (The image remains it's size, the view is set to say 150% and the image is stretched to 150% inside the view.) I use the NSSizeToFit option in the scaling for the imageview.
Now I thought my math was right to reset the selected area so that when the cropping took place the right area was selected however my math is WAY off as I get completely unpredictable results. This is the formula I was using :


float factor = originalSize.width / currentSize.size.width;

then to reset the selection:

selection.size.width /=factor;
selection.size.height /=factor;
selection.origin.x /=factor;
selection.origin.y /=factor;


I have also tried dividing it by the viewSize setting with the same unpredictable results.. So I cant figure out what I'm doing wrong.
_______________________________________________


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


  • Follow-Ups:
    • Re: after resizing an image...
      • From: Daniel Staal <email@hidden>
  • Prev by Date: Re: How to make NSComboBox work in fullscreen mode
  • Next by Date: [Moderator] Leopard API and iPhone SDK Discussion Reminder
  • Previous by thread: Re: How to make NSComboBox work in fullscreen mode
  • Next by thread: Re: after resizing an image...
  • Index(es):
    • Date
    • Thread