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

Re: after resizing an image...


  • Subject: Re: after resizing an image...
  • From: Daniel Staal <email@hidden>
  • Date: Thu, 18 Oct 2007 08:31:36 -0400

--As of October 17, 2007 8:02:10 PM -0700, Development is alleged to have said:

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;

--As for the rest, it is mine.

Width and height are total size, but origin isn't. You'll need two scaling factors here, one for the size of the selection and one for it's placement. (If the origin actually moves at all.)

Daniel T. Staal

---------------------------------------------------------------
This email copyright the author.  Unless otherwise noted, you
are expressly allowed to retransmit, quote, or otherwise use
the contents for non-commercial purposes.  This copyright will
expire 5 years after the author's death, or in 30 years,
whichever is longer, unless such a period is in excess of
local copyright law.
---------------------------------------------------------------
_______________________________________________

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


References: 
 >after resizing an image... (From: Development <email@hidden>)

  • Prev by Date: Re: NSTextView, Mail, and umlauts / combining marks / diacriticals
  • Next by Date: Re: NSTextView, Mail, and umlauts / combining marks / diacriticals
  • Previous by thread: after resizing an image...
  • Next by thread: [Moderator] Leopard API and iPhone SDK Discussion Reminder
  • Index(es):
    • Date
    • Thread