Questions tagged [quartz-2d]

Quartz 2D is the primary two-dimensional graphics rendering API for Mac OS X, part of the Core Graphics framework.

Quartz 2D is the primary two-dimensional graphics rendering API for Mac OS X, part of the Core Graphics framework.

From apple official document:

Quartz 2D provides low-level, lightweight 2D rendering with unmatched output fidelity regardless of display or printing device. Quartz 2D is resolution- and device-independent; you don’t need to think about the final destination when you use the Quartz 2D application programming interface (API) for drawing.

The Quartz 2D API is easy to use and provides access to powerful features such as transparency layers, path-based drawing, offscreen rendering, advanced color management, anti-aliased rendering, and PDF document creation, display, and parsing.

The Quartz 2D API is part of the Core Graphics framework, so you may see Quartz referred to as Core Graphics or, simply, CG.

Quartz 2D uses the painter’s model for its imaging. In the painter’s model, each successive drawing operation applies a layer of “paint” to an output “canvas,” often called a page.

For more information:

Related tags:

667 questions
6
votes
2 answers

How to set a gradient border on UIView?

It's very easy to put a simple border on a UIView. You simply link to QuartzCore, import it, and use: self.view.layer.borderColor = [UIColor redColor].CGColor; self.view.layer.borderWidth = 2.0f; My question is... Is there a way to make this border…
shawnwall
  • 4,549
  • 1
  • 27
  • 38
5
votes
1 answer

Procedurally animating the growing of a 2D plant

I'm trying to figure out the best way to procedurally animate the growing of a 2D plant in iOS. I want the plant to animate to give an encroaching feeling to the user. Basically, to animate the growing of a branch, with little buds that will…
5
votes
1 answer

UIBezierPath and applytransform

I am trying to implement a custom UIView which is basically a pie menu (something like a cake divided into slices). For that I am trying to draw a circle and a series of lines from the center, like the rays in a chart's wheel. I have successfully…
tmpz
  • 368
  • 3
  • 12
5
votes
1 answer

‘invalid context 0x0’ error when using CGContext* functions

/* Adding the Path */ UserGraphBuff = UIGraphicsGetCurrentContext(); CGContextSetRGBStrokeColor(UserGraphBuff,5,10,0,1); CGContextSetLineWidth(UserGraphBuff, 2 ); CGContextBeginPath(UserGraphBuff); //line to last user…
John Riselvato
  • 12,854
  • 5
  • 62
  • 89
5
votes
2 answers

How to draw to an NSView graphics context from inside a CVDisplayLink callback?

I have a simple game that renders 2D graphics to a frame buffer (not using any OpenGL). I was going to use a CVDisplayLink to get a clean framerate, however most examples on the web deal with OpenGL or QuickTime. So far I have a sub class of…
John
  • 1,143
  • 7
  • 10
5
votes
1 answer

Does CGImage support 16 bits per channel?

bitsPerComponent says it's at most 8, but a couple of Stack Overflow questions imply 16 is supported.
Kartick Vaddadi
  • 4,818
  • 6
  • 39
  • 55
5
votes
1 answer

How to create a CGLayer from a UIView for off-screen drawing

I have read what I believe to be the relevant parts of the Quartz 2D Programming Guide, but cannot find an answer to the following (they don't seem to talk a lot about iOS in the document): My application displays a drawing in a UIView. Every now…
McKrassy
  • 961
  • 2
  • 10
  • 19
5
votes
1 answer

Why is Quartz 2D text flip transform required on iPhone

From the Apple docs: In iOS, you must apply a flip transform to the current graphics context in order for the text to be oriented as shown in Figure 16-1. [A flip transform] involves inverting the y-axis and translating the origin point to the…
codecowboy
  • 9,835
  • 18
  • 79
  • 134
5
votes
2 answers

Drawing Image with CGImage?

I have a CGImageRef and I want to display it on an NSView. I already have an CGImageRef from source path but the following doesn't work: - (void)drawRect:(NSRect)rect { NSString * thePath = [[NSBundle mainBundle] pathForResource: @"blue_pict" …
Hebbian
  • 51
  • 1
  • 3
5
votes
1 answer

Apple iPad and PDF support

I have few questions related to the PDF and its use on the Apple iPad: 1) Does the iPad support all Quartz PDF functions (i.e. all CGPDFxxx functions/classes)? 2) Does the iPad support the PDF Kit? 3) Is it possible with any of one of both APIs,…
STeN
  • 51
  • 2
5
votes
2 answers

Quartz 2D or OpenGL ES? Pros and cons in the long term, possibility of migration to other platforms

I'm having a hard time deciding whether to go with Quartz2D or OpenGL for an iPad game. It will be 2D mostly, but effect-intense (simultaneous lighting effects for 10-30 objects, 10-20 simultaneous animations on the screen). So far, assuming i'm…
fspirit
  • 2,537
  • 2
  • 19
  • 27
5
votes
1 answer

Set a UIView scale transform without effecting other transforms

I have a UIView that I scale down when it is touched and scale back up when the touch is ended or cancelled. I had been scaling the view like this Scale down: CGAffineTransform transform = CGAffineTransformMakeScale(0.95, 0.95); self.transform =…
Darren
  • 10,091
  • 18
  • 65
  • 108
5
votes
2 answers

How to set up a user Quartz2D coordinate system with scaling that avoids fuzzy drawing?

This topic has been scratched once or twice, but I am still puzzled. And Google was not friendly either. Since Quartz allows for arbitrary coordinate systems using affine transforms, I want to be able to draw things such as floorplans using…
Jean-Denis Muys
  • 6,772
  • 7
  • 45
  • 71
5
votes
1 answer

Adding a CALayer sublayer inside of UIView init

I'm trying to add a CALayer as a sublayer in a UIView subclass, but when I add the sublayer inside the init method I get EXC_BAD_ACCESS when I add the view to another view or window. Init method: - (id)initWithTitle:(NSString *)title…
davey555
  • 720
  • 1
  • 7
  • 15
5
votes
3 answers

How do I create a new image by drawing on top of an existing one using Quartz?

i have a view with uiimageview i assign this uiimageview image by camera..now i want to do some drawing onto image....using coregraphics.i want to do something like this... select an area by touching and drawing line when line joins something like…
Rahul Vyas
  • 28,260
  • 49
  • 182
  • 256