简体   繁体   English

调整UIImage为Instagram大小[iOS]

[英]Resize UIImage for Instagram size [iOS]

When I captured the screen and save it as UIImage, the size will be (640x1136) , What I need exactly to set that UIImage center of plain white UIImage to post it into instagram with no crop! 当我捕获屏幕并将其另存为UIImage时,大小将为(640x1136),我需要准确地设置纯白色UIImage的UIImage中心以将其发布到instagram中而不会裁剪!

I used this code for resize the UIImage but it doesn't make what I need 我使用此代码来调整UIImage的大小,但不能满足我的需要

UIImage+Resize UIImage +调整大小

from that I used this code: 从那我使用了这段代码:

UIImage *thenew = [NewImg resizedImageWithContentMode:UIViewContentModeScaleAspectFit bounds:CGsizeMake(612,612) interpolationQuality:kCGInterpolationHigh];

Hope you help me with this one 希望你能帮我这个忙

SOLUTION By Logan 解决方案洛根

https://stackoverflow.com/a/10523275/2611971 https://stackoverflow.com/a/10523275/2611971

Your image resizing is fine, you just need to combine it with a square white background image. 调整图像大小是很好的,您只需要将其与方形白色背景图像结合即可。 Use something like this: https://stackoverflow.com/a/1358967/2611971 使用类似这样的东西: https : //stackoverflow.com/a/1358967/2611971

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM