是否可以将图像调整为特定尺寸? [英] Is it possible to resize images to specific size?

查看:62
本文介绍了是否可以将图像调整为特定尺寸?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含约800张图像的应用程序.有什么方法可以将图像重新调整为特定大小.我尝试使用以下代码:

I have an application which has around 800 images. Is there any way to re size the images to specific size. I have tried using the following code:

UIImage *image = [[UIImage imageNamed:recipeObj.recipeImage]
    _imageScaledToSize:CGSizeMake(64.0f, 61.0f)
 interpolationQuality:1];
cell.imageView.image = image;

此代码段向我发出警告.还有其他替代方法来调整图像大小吗?

This code snippet gives me a warning. Is there any other alternative way for resizing images?

推荐答案

您可以查看此博客文章:

You could look at this blog post :

http://vocaro .com/trevor/blog/2009/10/12/resize-a-uiimage-the-right-way/

最后,他将调整大小的代码作为类别附加在UIImage上.

At the end he's attached the resizing code as a category on UIImage.

这篇关于是否可以将图像调整为特定尺寸?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆