¡@

Home 

2014/10/15 ¤U¤È 10:13:39

iphone Programming Glossary: scaledheight

UIImage rounded corners

http://stackoverflow.com/questions/262156/uiimage-rounded-corners

we'll use to adjust the size. For example if we shrink an image by half scaleFactor will be 0.5. the scaledWidth and scaledHeight will be the original multiplied by the scaleFactor. IMPORTANT the targetHeight is the size of the space we're drawing into... original multiplied by the scaleFactor. IMPORTANT the targetHeight is the size of the space we're drawing into. The scaledHeight is the height that the image actually is drawn at once we take into account the ideal of maintaining proportions float scaleFactor.. take into account the ideal of maintaining proportions float scaleFactor 0.0 float scaledWidth targetSize.width float scaledHeight targetSize.height CGPoint thumbnailPoint CGPointMake 0 0 since not all images are square we want to scale proportionately...

UIImage: Resize, then Crop

http://stackoverflow.com/questions/603907/uiimage-resize-then-crop

CGFloat targetHeight targetSize.height CGFloat scaleFactor 0.0 CGFloat scaledWidth targetWidth CGFloat scaledHeight targetHeight CGPoint thumbnailPoint CGPointMake 0.0 0.0 if CGSizeEqualToSize imageSize targetSize NO CGFloat widthFactor.. widthFactor scale to fit height else scaleFactor heightFactor scale to fit width scaledWidth width scaleFactor scaledHeight height scaleFactor center the image if widthFactor heightFactor thumbnailPoint.y targetHeight scaledHeight 0.5 else if.. scaledHeight height scaleFactor center the image if widthFactor heightFactor thumbnailPoint.y targetHeight scaledHeight 0.5 else if widthFactor heightFactor thumbnailPoint.x targetWidth scaledWidth 0.5 UIGraphicsBeginImageContext targetSize..

Creating mask with CGImageMaskCreate is all black (iphone)

http://stackoverflow.com/questions/633051/creating-mask-with-cgimagemaskcreate-is-all-black-iphone

maskImage CGContextDrawImage mainViewContentContext CGRectMake thumbnailPoint.x thumbnailPoint.y scaledWidth scaledHeight self.CGImage Create CGImageRef of the main view bitmap content and then release that bitmap context CGImageRef mainViewContentBitmapContext..