开发者

better way to resize image?

开发者 https://www.devze.com 2023-01-11 09:47 出处:网络
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.

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

精彩评论

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