iphone Programming Glossary: heightfactor
UIImage rounded corners http://stackoverflow.com/questions/262156/uiimage-rounded-corners by dividing it by the intended width. Otherwise we'll use the height. float widthFactor targetSize.width width float heightFactor targetSize.height height if widthFactor heightFactor scaleFactor widthFactor else scaleFactor heightFactor ex 500 0.5 250.. use the height. float widthFactor targetSize.width width float heightFactor targetSize.height height if widthFactor heightFactor scaleFactor widthFactor else scaleFactor heightFactor ex 500 0.5 250 newWidth scaledWidth width scaleFactor scaledHeight.. width float heightFactor targetSize.height height if widthFactor heightFactor scaleFactor widthFactor else scaleFactor heightFactor ex 500 0.5 250 newWidth scaledWidth width scaleFactor scaledHeight height scaleFactor center the thumbnail in the frame...
UIImage: Resize, then Crop http://stackoverflow.com/questions/603907/uiimage-resize-then-crop CGPointMake 0.0 0.0 if CGSizeEqualToSize imageSize targetSize NO CGFloat widthFactor targetWidth width CGFloat heightFactor targetHeight height if widthFactor heightFactor scaleFactor widthFactor scale to fit height else scaleFactor heightFactor.. imageSize targetSize NO CGFloat widthFactor targetWidth width CGFloat heightFactor targetHeight height if widthFactor heightFactor scaleFactor widthFactor scale to fit height else scaleFactor heightFactor scale to fit width scaledWidth width scaleFactor.. targetHeight height if widthFactor heightFactor scaleFactor widthFactor scale to fit height else scaleFactor heightFactor scale to fit width scaledWidth width scaleFactor scaledHeight height scaleFactor center the image if widthFactor heightFactor..
|