question about CGAffineTransformTranslate
Posted
by www.ruu.cc
on Stack Overflow
See other posts from Stack Overflow
or by www.ruu.cc
Published on 2010-04-12T06:17:53Z
Indexed on
2010/04/12
6:23 UTC
Read the original article
Hit count: 397
cocoa-touch
CGRect rect1 = backgroundImageView.frame; NSLog(@"%f,%f,%f,%f",rect1.origin.x,rect1.origin.y,rect1.size.width,rect1.size.height);
angle = -90.0;
moveX = 0; moveY = 0.0;
CGFloat degreesToRadians = M_PI * angle / 180.0; CGAffineTransform landscapeTransform = CGAffineTransformMakeRotation(degreesToRadians); landscapeTransform = CGAffineTransformTranslate( landscapeTransform, moveX, moveY ); [backgroundImageView setTransform:landscapeTransform];
rect1 = backgroundImageView.frame; NSLog(@"%f,%f,%f,%f",rect1.origin.x,rect1.origin.y,rect1.size.width,rect1.size.height);
the debug message output: 0.000000,0.000000,320.000000,480.000000 -80.000000,80.000000,480.000000,320.000000
why does the (x,y) changes to (-80,80)?
© Stack Overflow or respective owner