Questions tagged [quartz-graphics]

Quartz is graphic framework used on Mac OS X. It forms a graphic layer. Term Quartz is used to represent Quartz 2D and Quartz Compositor. Quartz graphic is a 2D renderer in Core Graphics.

1214 questions
14
votes
4 answers

iOS iPhone is it possible to clone UIView and have it draw itself to two UIViews?

I'm thinking of a way to have a UIView render itself onto another UIView as well as the first one. So I have my main UIView with it's bounds, and the UIView also renders itself in some other UIView. Is this possible ? Does it require extensive layer…
Alex Stone
  • 46,408
  • 55
  • 231
  • 407
13
votes
2 answers

Adding a mask with CALayers

I seem to be having difficulties adding a mask via CALayers. I'm simply trying to mask a UIImageView. Here's my code: CALayer *maskLayer = [CALayer layer]; UIImage *mask = [UIImage imageNamed:@"mask.png"]; maskLayer.contents = mask; UIImageView…
user339946
  • 5,961
  • 9
  • 52
  • 97
13
votes
2 answers

3D Carousel effect on the iPad

I am trying to implement a 3D Carousel on the iPad, consisting of UIViews, an effect like what is shown over here. I have gone through many similar questions on SO, but didn't find any staisfactory answers or no answers at all. I am trying to…
Vin
  • 10,517
  • 10
  • 58
  • 71
13
votes
2 answers

Compile error trying to use CAGradientLayer

I'm trying to use CAGradientLayer and getting an unhelpful compile error. Can't figure out whats wrong. All I'm doing so far is: CAGradientLayer *gradient = [CAGradientLayer layer]; I've imported and I'm getting the…
Rudiger
  • 6,749
  • 13
  • 51
  • 102
13
votes
2 answers

Adjacent CAShapeLayer Antialiasing Issue

I'm drawing a pie chart using a CAShapeLayer for each slice of the pie. Even when the end angle of one pie slice is equal to the start angle of the adjacent slice, antialiasing is resulting in the underlying background color appearing between each…
Aaron
  • 311
  • 2
  • 10
13
votes
3 answers

CGContextSetLineWidth(context, 1) - the width is almost alwayas at least 2 pixels instead 1

With CGContextSetLineWidth(context, 1) the width is almost alwayas at least 2 pixels instead 1 QQCandleStickLayer.m -(id)init { self = [super init]; if(self != nil) { self.delegate = self; self.opaque = NO; …
freennnn
  • 355
  • 2
  • 10
13
votes
5 answers

CATiledLayer blanking tiles before drawing contents

All, I'm having trouble getting behavior that I want from CATiledLayer. Is there a way that I can trigger the tiles to redraw without having the side-effect that their areas are cleared to white first? I've already subclassed CATiledLayer to set…
Greg Plesur
  • 131
  • 1
  • 5
12
votes
2 answers

What's faster: Creating a gradient programmatically using Quartz2D or just importing an image?

Let's assume the file space on the iphone isn't an issue, what would perform better? Would there be any noticeable speed/smoothness difference between the two?
Vadoff
  • 9,219
  • 6
  • 43
  • 39
12
votes
2 answers

Use iTerm2 as X11 terminal (for fonts, themes, etc)?

I have to use Quartz X11 window when I want to plot data that is on a remote server (using NX). I'd like to use my iTerm terminal as the interface to this, as it is nicely customized with fonts, themes, etc - instead of the bare xterm window. How do…
Andrew
  • 6,295
  • 11
  • 56
  • 95
12
votes
3 answers

Saving and restoring CGContext

I'm trying to save and restore a CGContext to avoid doing heavy drawing computations for a second time and I'm getting the error : CGGStackRestore: gstack underflow. What am I doing wrong? What is the correct way to do this? -…
cocoatoucher
  • 1,483
  • 3
  • 17
  • 22
12
votes
3 answers

openGL ES textures from PNGs with transparency are being rendered with weird artifacts and driving me nuts!

I am beginning to work on my first OpenGL iPhone app, but I've hit an early snag. I have a VERY SIMPLE little texture that I want to use as a sprite in a 2D game, but it renders with weird 'randomly' colored pixels up…
Super Toaster Fiend
11
votes
4 answers

Get size of repeated pattern from UIColor?

I can query if a UIColor is a pattern by inspecting the CGColor instance it wraps, the CGColorGetPattern() function returns the pattern if it exist, or null if it is not a pattern color. CGPatternCreate() method requires a bounds when creating a…
PeyloW
  • 36,742
  • 12
  • 80
  • 99
11
votes
6 answers

How do I create a grid of icons like the iPhone home screen?

How should I go about creating a UI similar to the Springboard (home screen) on the iPhone? I'd like a grid of evenly spaced buttons with images where I can respond to the button tap. Is the UITable a good fit? Should I use a plain UIView and…
Nick VanderPyle
  • 2,939
  • 3
  • 26
  • 33
11
votes
1 answer

How to use CGPathApply properly

I'm trying to use CGPathApply to iterate over each CGPathElement in a CGPathRef object (mainly to write a custom way to persist CGPath data). The problem is, each time it get to the call to CGPathApply, my program crashes without any information at…
Eric
  • 1,688
  • 2
  • 15
  • 13
11
votes
3 answers

Core Graphics coordinate system

When overriding drawRect I've found that the coordinates there use 0,0 as the upper left. But the Apple UIView Programming Guide says this: Some iOS technologies define default coordinate systems whose origin point and orientation differ from those…
johnbakers
  • 24,158
  • 24
  • 130
  • 258