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
5
votes
1 answer

CGContextStrokePath triggers EXC_BAD_ACCESS in iOS > 5

I have a custom UIButton class that adds a gradient and a gloss effect to the UIButton the code works perfectly in iOS 4 and on iOS5 simulator but when i run it on iOS 5 devices it gives me the exception EXC_BAD_ACCESS , the exception is triggered…
ahmad
  • 1,212
  • 1
  • 14
  • 28
5
votes
6 answers

iPhone: how to draw text in a window?

Strange situation - examples from apple works, but after i change them a bit, text is not displayed. This bit of code correctly draws blue background but refuses to draw text on it no matter what i do: #import @interface CWnd :…
grigoryvp
  • 40,413
  • 64
  • 174
  • 277
5
votes
4 answers

Combining Intersecting CGPaths on iOS

I have a problem in an app I'm working on. Say I have two CGPaths that are fairly complex and I add them both to a CGMutablePath (thus combining them). Well, where the two paths intersect there will be points inside of each other. I want to…
daveMac
  • 3,041
  • 3
  • 34
  • 59
4
votes
1 answer

CoreAnimation, moving UIImageView with animating shadow in iOS 5 Xcode 4

I am trying to add a (fake)3d like effect for an image (UIImageView moving from point A to B, during this movement I want at point C=(A+B)/2 for it to have the biggest shadow size (or larger shadow offset), so it looks like it is going up and down…
Nabi
  • 393
  • 1
  • 5
  • 13
4
votes
1 answer

In CoreGraphics drawing how can I keep the point of overlap from being darker than the rest of the line?

My app uses core graphics for custom finger paint drawing. I allow the user to change the alpha of the line and a new line is continuously drawn on touches moved. When I make the alpha lower than 1.0 the point of overlap is darker than the rest of…
Aspyn
  • 647
  • 1
  • 10
  • 25
4
votes
1 answer

CGLayer and Anti-aliased CGPaths

I am drawing several CGPaths in a Cocoa view in the drawRect method on an iPad. I started out drawing them straight to the UIGraphicsGetCurrentContext() context, but performance went south when my paths got really long. Based on several other…
Streeter
  • 556
  • 4
  • 22
4
votes
2 answers

What this error is invalid context 0x0?

I wrote the following code in ViewDidLoad // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. -(void)viewDidLoad { [super viewDidLoad]; NSString *str = [NSString…
Chatar Veer Suthar
  • 15,541
  • 26
  • 90
  • 154
4
votes
3 answers

Drawing an angle/angular/"Conical"/"Arcing" gradient in Objective-C (IOS) using Core Graphics

I'm trying to draw a "conical"/"arcing" gradient (I don't know what would be the correct term for this) (Photoshop calls it an "angle" gradient —your friendly neighborhood stackoverflow editor) using Objective-C (IOS), pretty much exactly like the…
Mordack
  • 43
  • 1
  • 3
4
votes
2 answers

Drawing Game Center like tableview cells

I've now added a bounty which will be awarded to anyone who can take the three images below and produce a working implementation of a UITableView that mimicks the look and feel of the one found in Game Center on the Games tab. The implementation…
user814037
4
votes
2 answers

Copying the drawn contents of one UIView to another

I'd like to take a UITextView and allow the user to enter text into it and then trigger a copy of the contents onto a quartz bitmap context. Does anyone know how I can perform this copy action? Should I override the drawRect method and call [super…
Joey
  • 7,537
  • 12
  • 52
  • 104
4
votes
1 answer

how do I get a PDF object (string,image,etc) that was touched by user?

I am using CGPDF* set of classes to read a pdf document, is there a way to extract the object that was touched ('clicked') by user? In other way is there a way to get a PDF / (Quartz?) object at certain coordinates?
adrin
  • 3,738
  • 8
  • 40
  • 60
4
votes
3 answers

How do I make my own recordedPath in GLPaint Sample Code

I've recently downloaded the GLPaint sample code and looked at a very interesting part in it. There is a recordedPaths NSMutableArray that has points in it that are then read and drawn by GLPaint. It's declared here: NSMutableArray…
gizmoitai
  • 41
  • 4
4
votes
3 answers

Custom UIBarButtonItem with quartz

How can I draw a button with quartz that has exactly the same style as a UIBarButtonItem. The button should be able to show different colors. I downloaded the Three20 project, but this project is really complex, you'd need a lot of time to overlook…
burki
  • 2,946
  • 6
  • 37
  • 51
4
votes
2 answers

MacOS X 10.9 - Link application to previous version of (Apple) PDFKit framework

After Mac OS X 10.7.5 there is a consistent (and undocumented) behaviour change in Quartz-PDFKit's method characterBoundsAtIndex of the PDFPage class. As you get the text of your pdfPage as an NSString with text = [pdfPage string]; and retrieve…
Paolo
  • 15,233
  • 27
  • 70
  • 91
4
votes
1 answer

CGBitmapInfo value performance on iOS

I am drawing pieces of a CGBitmapContext in the drawRect of a UIView. What are the best CGBitmapInfo enum values to ensure that performance is optimal? Right now I am using kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder32Big, but I have also…
jjxtra
  • 20,415
  • 16
  • 100
  • 140