zoukankan      html  css  js  c++  java
  • 一个实现图片放大缩小的笨办法

     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
  • 相关阅读:
    设计模式——设计模式之禅day2
    和阿文一起学H5——音乐素材
    mysql数据库问题
    vue-cli脚手架工具
    webpack总结
    sql和nosql区别
    MongoDB基本命令
    >nbsp修改
    字典
    列表
  • 原文地址:https://www.cnblogs.com/grq186/p/4177196.html
Copyright © 2011-2022 走看看