开发者

how to reduce imagesize in iphone

开发者 https://www.devze.com 2023-02-01 11:18 出处:网络
Iam new to iphone currently my problem is i displayed 6 images in i开发者_高级运维mage viewIt was not showing images in imageview I think the imageviews are in large size

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

精彩评论

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