• 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
Translating selection area in imageView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Translating selection area in imageView


  • Subject: Translating selection area in imageView
  • From: Development <email@hidden>
  • Date: Sun, 6 Sep 2009 11:50:05 -0700

I am using the croppingImageView example to allow me to place a picture of the desktop in to a window (about 400X300). I then want to be able to select an area of that picture and translate it to pick up that part of the desktop however what I get is completely unpredictable. It almost looks like the selection is off by the height of the selection but attempting to add the height of the selection to the origin.y seems to make no change what so ever. Below is the code I'm using to translate the selection.

double percent = [movieWidth doubleValue] / [theScreen frame].size.width;

selected.origin.x = selection.origin.x *([theScreen frame].size.width/ ([theScreen frame].size.width *percent));

selected.origin.y = selection.origin.y / percent;

selected.size.height = selection.size.height / percent;
selected.size.width = selection.size.width / percent;

movieFrame.size.width = [movieWidth doubleValue];
movieFrame.size.height = [theScreen frame].size.height * percent;
_______________________________________________

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: Get error message about registered observers when Object receives dealloc message
  • Next by Date: Re: NSArrayController design/usage question
  • Previous by thread: Re: website like ebay.com's flash content crashing webKit like app?
  • Next by thread: NSDivideRect and 64-bit
  • Index(es):
    • Date
    • Thread