ios 用objective c语言编写的tomcat动画

本文探讨了图像处理和AR特效技术的应用,包括OpenGL ES滤镜、OpenCV图像处理等,展示了如何在实际场景中实现高质量的图像效果和增强现实体验。
#import "ViewController.h"

@interface ViewController ()
{
UIImageView *_image;
NSMutableArray *_milkArray;
}

@end

@implementation ViewController


- (void)viewDidLoad {
[super viewDidLoad];
_image=[[UIImageView alloc] initWithFrame:self.view.bounds];
[_image setImage:[UIImage imageNamed:@"stomach_0.jpg"]];
[self.view addSubview:_image];
float width=self.view.bounds.size.width;
float height=self.view.bounds.size.height;
UIButton *milkButton=[UIButton buttonWithType:UIButtonTypeCustom];
[milkButton setBackgroundColor:[UIColor clearColor]];
[milkButton setFrame:CGRectMake(width/2-100, height/2-100, 200, 80)];
[self.view addSubview:milkButton];
[milkButton addTarget:self action:@selector(milkButtonClick) forControlEvents:UIControlEventTouchUpInside];
_milkArray = [NSMutableArray array];
for(int i=0;i<=80;i++)
{
//格式化字符串
NSString *imgName=[NSString stringWithFormat:@"drink_%d.jpg",i];
//创建图片对象
UIImage *image=[UIImage imageNamed:imgName];
[_milkArray addObject:image];
}
}

-(void)milkButtonClick
{
[_image setAnimationImages:_milkArray];
//设置动画时长
[_image setAnimationDuration:10.0];
//设置动画重复次数
[_image setAnimationRepeatCount:1];
[_image startAnimating];
}

- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}

@end
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值