首页 > 其他 > 详细

一个实现图片放大缩小的笨办法

时间:2014-12-21 23:19:51      阅读:350      评论:0      收藏:0      [点我收藏+]
 1 #import "UITestAppAppDelegate.h"
 2 
 3 @implementation UITestAppAppDelegate
 4 
 5 @synthesize window;
 6 @synthesize img;
 7 
 8 - (void) applicationDidFinishLaunching:(UIApplication *)application{
 9     CGRect frame = CGRectMake(80, 100, 80, 120);
10     img = [[UIImageView alloc] initWithFrame:frame];
11     [img setImage:[UIImage imageNamed:@"4.png"]];
12     [window addSubview:img];
13     [window makeKeyAndVisible];    
14 }
15 -(IBAction) increaseSizeButtonPressed{
16     CGRect newframe = CGRectMake(20, 50, 240, 360);
17     img = [[UIImageView alloc] initWithFrame:newframe];
18     [img setImage:[UIImage imageNamed:@"4.png"]];
19     img.frame = newframe;
20     [window addSubview:img];
21 }
22 -(IBAction) decreaseSizeButtonPressed{
23     CGRect newframe = CGRectMake(0, 0, 32, 48);
24      img = [[UIImageView alloc] initWithFrame:newframe];
25     [img setImage:[UIImage imageNamed:@"4.png"]];
26     [window addSubview:img];
27     img.frame = newframe;
28 }
29 - (void)dealloc {
30     [img release];
31     [window release];
32     [super dealloc];
33 }
34 
35 
36 @end

 

一个实现图片放大缩小的笨办法

原文:http://www.cnblogs.com/grq186/p/4177196.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!