¡@

Home 

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

iphone Programming Glossary: scaledwidth

How to convert an NSTimeInterval (seconds) into minutes

http://stackoverflow.com/questions/1189252/how-to-convert-an-nstimeinterval-seconds-into-minutes

UIImage rounded corners

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

the fraction that 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.. image actually is drawn at once we 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.. 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. if wider than tall we need to adjust..

UIImage: Resize, then Crop

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

CGFloat targetWidth targetSize.width CGFloat targetHeight targetSize.height CGFloat scaleFactor 0.0 CGFloat scaledWidth targetWidth CGFloat scaledHeight targetHeight CGPoint thumbnailPoint CGPointMake 0.0 0.0 if CGSizeEqualToSize imageSize.. 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 thumbnailPoint.y targetHeight.. thumbnailPoint.y targetHeight scaledHeight 0.5 else if widthFactor heightFactor thumbnailPoint.x targetWidth scaledWidth 0.5 UIGraphicsBeginImageContext targetSize this will crop CGRect thumbnailRect CGRectZero thumbnailRect.origin thumbnailPoint..

Creating mask with CGImageMaskCreate is all black (iphone)

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

targetSize.height 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..