Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

fladnag

macrumors newbie
Original poster
Oct 3, 2008
3
0
I want to read the scale of a view into a variable but I only know how to read a view's pixel size in. Like this:
Code:
int viewWidth = myView.frame.size.width;

Can anyone tell me how to do it the other way, so that I can set a float with the view's scale - .90 or 2.50 or such?
Code:
float viewScale = myView. ??? scale??
 

chbeer

macrumors member
Sep 22, 2008
82
0
Berlin
Do you mean the scale set by a transform-matrix? If you mean that, it is possible to get the values by getting the transform-matrix and reading the appropriate fields. (I hope I remember correctly that there are 2 fields for scaling)
 

lawicko

macrumors member
Jul 17, 2008
44
0
Exactly, see CGAffineTransformMakeScale method in documentation to see which fields you need to read.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.