开发者

how to reduce imagesize in iphone

Iam new to iphone currently my problem is

i displayed 6 images in i开发者_高级运维mage view It was not showing images in imageview I think the imageviews are in large size

so plz send me code for this imageview.

Thank u in advance.


You could use this for image resizing:

- (UIImage *)rescaleImageToSize:(CGSize)size {
    CGRect rect = CGRectMake(0.0, 0.0, size.width, size.height);
    UIGraphicsBeginImageContext(rect.size);
    [self drawInRect:rect];  // scales image to rect
    UIImage *resImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    return resImage;
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜