简体   繁体   English

如何通过宽度调整图像尺寸并保持宽高比

[英]How to resize a image by it's width and Maintain Aspect Ratio

I want to resize or scale a image down by it's width is fixed. 我想通过固定宽度来调整图像尺寸或缩小图像。 I have been searching all over the network, it's about resizing the image to new size by specifying new CGSize value. 我一直在整个网络中搜索,这是通过指定新的CGSize值将图像调整为新大小。 I only want to scale it down by its width is fixed, like 100px, and the height scale down and Maintain it's Aspect Ratio. 我只想按固定的宽度将其缩小,例如100px,将高度缩小并保持其宽高比。

check this out and modify as per your needs. 请检查并根据您的需要进行修改。

http://code.developwithus.com/iphone/resize-image-in-iphone-sdk/ http://code.developwithus.com/iphone/resize-image-in-iphone-sdk/

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

相关问题 如何使用宽高比调整图像大小? - How to resize image with aspect ratio? 通过保持纵横比和宽度来调整 UIImage 的大小 - Resize UIImage by keeping Aspect ratio and width 使用自动布局将图像宽度调整为100%,同时保持宽高比 - Using auto layout to resize image width to 100% while keeping the aspect ratio 旋转后如何调整相机的宽高比? - How to resize camera aspect ratio after rotation? 用宽高比调整UIImage的大小? - Resize UIImage with aspect ratio? 如何在保持其纵横比的同时调整AsyncImageView(UIImageView的子类)的大小 - How to resize AsyncImageView (subclass of UIImageView) while maintaining its Aspect Ratio 转换视频时保持长宽比? -ffmpeg - Maintain aspect ratio when converting video? - ffmpeg 如何更改Jssor Image Slider的尺寸,而不会仅仅在iPhone设备上失去它的响应特性,图像宽高比等? - How to change the dimensions of the Jssor Image Slider without losing it's responsive nature, image aspect ratio, etc. only on iPhone device? NSLayoutConstraints 代码使视图居中并保持其纵横比 - NSLayoutConstraints code to center a view and maintain its aspect ratio 使用UIImagePickerController加载的图像的长宽比 - Aspect ratio of image loaded using UIImagePickerController
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM