after resizing an image...
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