开发者

better way to resize image?

Im using CGBitmapContextCreate to read the data from a png file. I then resize the image with a couple of loops to fit the OpenGL ES image size criteria.

I was wondering if there is a better way to this.

Basically what I d开发者_JS百科o now is have a nested loop like:

for(i<newHeight){
   for(j<newWidth){
      copy image data
   }
}

For instance can I pass the new sizes to the CGBitmapContextCreate when reading the data?


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

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜