core-graphics

Make superlayer not visible

I have added sublayers to my UIView's layer. However, the root layer(UIView's layer) is visible at background as white rectangle. How can I effeciently hide superlayer so there will be no resourses spent on compositing with sublayers? ...

saving images in lower quality(256, 16, 4, 2 colors) - cocoa

Hi. I am trying to work with images in Cocoa - open images and manipulate with them. I take ImageApp as example . All work fine, but I need to save images in lower quality -(8, 4, 2, 1 bits per pixel - 256, 16, 4, 2 colors respectively). According to documentation, the "lowest" pixel format is Gray 8 bpp, 8 bpc,kCGImageAlphaNone and i...

CGContextSetLineWidth of varying width around path

In one of my apps, I have a custom drawn semitransparent UIView that I use as a cover on top of another UIView for a special effect. Lower View: Lower View with Custom View on Top: It works, its great on the iPhone where the side margins are only 10 pixels, but now I need to expand the left and right margins to match the row below i...

Simulating selected tab bar effect

Partly as a programming exercise, and partly because we may need to include such images in an app some day, I've been trying to figure out how to draw an image like the selected tab in a UITabBar. The basic operation is simple enough in concept: the icon's alpha is used as a mask to draw the blue gradient image onto the tab. (Though I c...

Is there any reason to use Core Graphics data types when working with UIView objects

Is there any real need to do this: CGFloat x = 10.0f; CGFloat y = 20.0f; someView.center = CGPointMake(x, y); Instead of this: float x = 10.0; float y = 20.0; someView.center = CGPointMake(x, y); ...aside from style considerations? Are there any performance implications at all? ...

How to draw dotted circles using graphics in iphone sdk ?

Hi all, I am implementing a graphic based application. I am very new to graphics, I need to display a dotted circle in my view. Is it possible to draw a dotted circle in using graphics, can you guys please help how to do it? Thanks in advance, S. ...