Translating selection area in imageView
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