Corona中文站

强大、易学的跨平台(iOS/Android)开发框架。QQ群1:74390406(满) 群2:221929599

导航

iphone从一个图片截取部分区域生成新的小图
UIImage *image = [[UIImage alloc] initWithData:data];//大图

CGRect imageRect = CGRectMake(0.0, 0.0, image.size.width, image.size.height);

CGSize itemSize = CGSizeMake(w,h);

UIGraphicsBeginImageContext(itemSize);

[image drawInRect:imageRect];

UIImage *smallimage = UIGraphicsGetImageFromCurrentImageContext();

UIGraphicsEndImageContext();
<< iphone显示本地的图片【代码】iphone如何将图片保存到相册中 >>

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

最近发表

Powered By Z-Blog 1.8 Walle Build 100427 Copyright 2011-2015 BuildApp.Net. All Rights Reserved.