博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

图片从中心放大到一定大小

Posted on 2011-09-08 17:02  星尘的天空  阅读(246)  评论(0编辑  收藏  举报

图片以某一点为中心放大。

参考代码:

m_imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"诚实守信-华盛顿砍树9.jpg"]];

m_imageView.center = self.view.center;

m_imageView.frame = CGRectMake(502, 384, 0, 0);//ipad中的横屏幕模式

[self.view addSubview:m_imageView];

另一个按钮的单击时间,实现以某一点为中心进行方法

参考代码:

-(IBAction)GoToIndexPage

{

  [UIView beginAnimations:@"animationID" context:nil];

  [UIView setAnimationDuration:3.0];

  [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];

  [UIView setAnimationRepeatAutoreverses:NO];

  CGRect newRect = CGRectMake(0, 0, 1024, 768); //ipad横屏模式下的大小 

  m_imageView.frame = newRect;

  [UIView commitAnimations];

}

THE END !