iphone Programming Glossary: self.bounds.size.height
How can I change the saturation of an UIImage? http://stackoverflow.com/questions/1144768/how-can-i-change-the-saturation-of-an-uiimage rect CGContextRef context UIGraphicsGetCurrentContext CGContextSaveGState context CGContextTranslateCTM context 0.0 self.bounds.size.height flip image right side up CGContextScaleCTM context 1.0 1.0 CGContextDrawImage context rect self.image.CGImage CGContextSetBlendMode..
Flipped NSString drawing in CGContext http://stackoverflow.com/questions/1252343/flipped-nsstring-drawing-in-cgcontext state. This would look something like the following CGContextSaveGState context CGContextTranslateCTM context 0.0f self.bounds.size.height CGContextScaleCTM context 1.0f 1.0f text drawAtPoint CGPointMake 0.0f 0.0f withFont font CGContextRestoreGState context..
How do I add a gradient to the text of a UILabel, but not the background? http://stackoverflow.com/questions/1266179/how-do-i-add-a-gradient-to-the-text-of-a-uilabel-but-not-the-background it CGContextRef context UIGraphicsGetCurrentContext CGContextSaveGState context CGContextTranslateCTM context 0.0f self.bounds.size.height CGContextScaleCTM context 1.0f 1.0f CGContextSelectFont context Helvetica 20.0f kCGEncodingMacRoman CGContextSetTextDrawingMode..
underline text in UIlabel http://stackoverflow.com/questions/2711297/underline-text-in-uilabel ctx 207.0f 255.0f 91.0f 255.0f 44.0f 255.0f 1.0f RGBA CGContextSetLineWidth ctx 1.0f CGContextMoveToPoint ctx 0 self.bounds.size.height 1 CGContextAddLineToPoint ctx self.bounds.size.width self.bounds.size.height 1 CGContextStrokePath ctx super drawRect rect.. ctx 1.0f CGContextMoveToPoint ctx 0 self.bounds.size.height 1 CGContextAddLineToPoint ctx self.bounds.size.width self.bounds.size.height 1 CGContextStrokePath ctx super drawRect rect UPD As of iOS 6 Apple added NSAttributedString support for UILabel so now..
iPhone, CGPDFDocument - PDF links http://stackoverflow.com/questions/3257057/iphone-cgpdfdocument-pdf-links Left coordinate system so we flip the coordinate system before we start drawing. CGContextTranslateCTM context 0.0 self.bounds.size.height CGContextScaleCTM context 1.0 1.0 Grab the first PDF page CGPDFPageRef page CGPDFDocumentGetPage pdf pageNumber We're about..
Fast and Lean PDF Viewer for iPhone / iPad / iOs - tips and hints? http://stackoverflow.com/questions/3889634/fast-and-lean-pdf-viewer-for-iphone-ipad-ios-tips-and-hints scale CGFloat scaleForWidth baseImage.size.width self.bounds.size.width CGFloat scaleForHeight baseImage.size.height self.bounds.size.height CGFloat imageScaleFactor MAX scaleForWidth scaleForHeight CGSize imageSize CGSizeMake baseImage.size.width imageScaleFactor.. baseImage.size.height imageScaleFactor CGRect imageRect CGRectMake self.bounds.size.width imageSize.width 2 self.bounds.size.height imageSize.height 2 imageSize.width imageSize.height CGContextDrawImage context imageRect baseImage CGImage else @synchronized..
Change background color of UIButton when Highlighted http://stackoverflow.com/questions/4022763/change-background-color-of-uibutton-when-highlighted sizeof colors 0 4 CGColorSpaceRelease rgb CGContextDrawLinearGradient ctx gradient CGPointMake 0 0 CGPointMake 0 self.bounds.size.height 0 CGGradientRelease gradient else Do custom drawing for normal state void dealloc self removeObserver self forKeyPath @..
Drawing app on iPad using OpenGL http://stackoverflow.com/questions/4606680/drawing-app-on-ipad-using-opengl the above is in C this is in Obj C Invert the Y axis to conform the iPhone top down approach invertedYBegCoord self.bounds.size.height currentStroke objectAtIndex i CGPointValue .y invertedYEndCoord self.bounds.size.height currentStroke objectAtIndex i 1.. approach invertedYBegCoord self.bounds.size.height currentStroke objectAtIndex i CGPointValue .y invertedYEndCoord self.bounds.size.height currentStroke objectAtIndex i 1 CGPointValue .y invertedYThirdCoord self.bounds.size.height currentStroke objectAtIndex.. .y invertedYEndCoord self.bounds.size.height currentStroke objectAtIndex i 1 CGPointValue .y invertedYThirdCoord self.bounds.size.height currentStroke objectAtIndex i 2 CGPointValue .y Figure our how many dots you need count MAX ceilf sqrtf currentStroke objectAtIndex..
How to draw a color wheel in objective-c http://stackoverflow.com/questions/5108921/how-to-draw-a-color-wheel-in-objective-c bitmapData dim luminance UIImage image createUIImageWithRGBAData bitmapData self.bounds.size.width self.bounds.size.height CFRelease bitmapData image drawAtPoint CGPointZero image release void generateColorWheelBitmap UInt8 bitmap int widthHeight..
UITextView ruled line background but wrong line height http://stackoverflow.com/questions/5375350/uitextview-ruled-line-background-but-wrong-line-height add a bit more height to draw lines in the empty part of the view NSUInteger numberOfLines self.contentSize.height self.bounds.size.height self.font.leading Set the line offset from the baseline. I'm sure there's a concrete way to calculate this. CGFloat baselineOffset..
Is there an SDK to draw lines on iOS with touch? http://stackoverflow.com/questions/6774352/is-there-an-sdk-to-draw-lines-on-ios-with-touch 20 UIGraphicsBeginImageContext self.bounds.size drawImage.image drawInRect CGRectMake 0 0 self.bounds.size.width self.bounds.size.height CGContextSetLineCap UIGraphicsGetCurrentContext kCGLineCapRound CGContextSetLineWidth UIGraphicsGetCurrentContext 5.0 if.. UIGraphicsBeginImageContext self.bounds.size drawImage.image drawInRect CGRectMake 0 0 self.bounds.size.width self.bounds.size.height CGContextSetLineCap UIGraphicsGetCurrentContext kCGLineCapRound CGContextSetLineWidth UIGraphicsGetCurrentContext 5.0 CGContextMoveToPoint..
Custom UISlider: avoid updating when dragging outside http://stackoverflow.com/questions/8287413/custom-uislider-avoid-updating-when-dragging-outside self if touchLocation.x 0 touchLocation.y 0 return if touchLocation.x self.bounds.size.width touchLocation.y self.bounds.size.height return super touchesBegan touches withEvent event void touchesMoved NSSet touches withEvent UIEvent event CGPoint touchLocation.. self if touchLocation.x 0 touchLocation.y 0 return if touchLocation.x self.bounds.size.width touchLocation.y self.bounds.size.height return super touchesMoved touches withEvent event void touchesEnded NSSet touches withEvent UIEvent event CGPoint touchLocation.. self if touchLocation.x 0 touchLocation.y 0 return if touchLocation.x self.bounds.size.width touchLocation.y self.bounds.size.height return super touchesEnded touches withEvent event void touchesCancelled NSSet touches withEvent UIEvent event CGPoint touchLocation..
|