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
9
votes
5 answers

iPhone: Blur UIImage

In my iPhone application I have a black-and-white UIImage. I need to blur that image (Gaussian blur would do). iPhone clearly knows how to blur images, as it does that when it draws shadows. However I did not found anything related in the API. Do I…
Alexander Gladysh
  • 39,865
  • 32
  • 103
  • 160
9
votes
2 answers

How do I achieve continuous rotation of an NSImage inside NSImageView?

FUTURE VIEWERS: I have managed to finish this rotation animation and code with description can be found on tho question. NSImage rotation in NSView is not working Before you proceed please up vote Duncan C 's answer. As I manage to achieve this…
TeaCupApp
  • 11,316
  • 18
  • 70
  • 150
8
votes
1 answer

CALayer subclass "drawInContext" called but not drawing?

I am trying to draw in a CALayer subclass. The drawInContext is called with setNeedsDisplay but nothing is drawn. What am doing/getting wrong here ? - (void)drawInContext:(CGContextRef)ctx { CGContextSetFillColorWithColor(ctx, [UIColor…
shannoga
  • 19,649
  • 20
  • 104
  • 169
8
votes
3 answers

How to obtain a CGImageRef from the content of an UIView?

I have an UIView where I was drawing some stuff inside -drawRect:. Now I need a CGImageRef from this graphics context or bitmap of the UIView. Is there an easy way to get that?
openfrog
  • 40,201
  • 65
  • 225
  • 373
8
votes
2 answers

Set blendmodes on UIImageViews like Photoshop

I've been trying to apply blend modes to my UIImageViews to replicate a PSD mock up file (sorry can't provide). The PSD file has 3 layers, a base color with 60% normal blend, an image layer with 55% multiply blend and a gradient layer with 35%…
SleepNot
  • 2,982
  • 10
  • 43
  • 72
7
votes
2 answers

Drawing a line with a shadow, but only want to keep shadow. IOS

I am trying to draw a line with a shadow but I do not want to keep the line but only the shadow. I have attempted to set the stroke color of the line to clear but when I do that the shadow also disappears. The following code creates 2 lines, i only…
Rob
  • 71
  • 1
  • 2
7
votes
2 answers

Reduce the size of PDF file generated with Quartz2D

I'm looking for a way to reduce PDF size that I generate with Quartz. I'm drawing images with CGContextDrawImage in a CGPDFContext. What I'm afraid of is that the images are saved as Bitmap and not JPEG. Is there a way to check for that and a way to…
Kamchatka
  • 3,597
  • 4
  • 38
  • 69
7
votes
1 answer

CG Raster Data - CGProviderCreateWithCopyOfData - Unable to Release?

I am trying to find the source of a memory leak as detailed here : Unable to Release Quartz 2D and Core Text created Images When I use instruments I can see that there is something called CG Raster Data steadily growing in size which is never…
7
votes
4 answers

Quartz 2D vs OpenGL ES Learning Curve

I have been developing iPhone Applications for a couple of months. I would like to know your views about the Quartz vs OpenGL ES 1.x or 2.0 learning curve. You can tell your perspective. My Questions are *I am a wannabe game developer, So is it a…
felix
  • 11,304
  • 13
  • 69
  • 95
7
votes
2 answers

How to display text using Quartz on the iPhone?

I've been trying to display text using a Quartz context, but no matter what I've tried I simply haven't had luck getting the text to display (I'm able to display all sorts of other Quartz objects though). Anybody knows what I might be doing…
Robert Gould
  • 68,773
  • 61
  • 187
  • 272
7
votes
4 answers

Quartz2D: How to convert a clipping rect to an inverted mask at runtime?

Given: a CGContextRef (ctx) with frame {0,0,100,100} and a rect (r), with frame {25,25,50,50} It's easy to clip the context to that rect: CGContextClipToRect(ctx, r); to mask out the red area below (red == mask): But I want to invert this…
Todd Ditchendorf
  • 11,217
  • 14
  • 69
  • 123
7
votes
3 answers

How can I generate a PDF with "real" text content on iOS?

I want to generate a good-looking PDF in my iOS 6 app. I've tried: UIView render in context Using CoreText Using NSString drawInRect Using UILabel drawRect Here is a code example: -(CGContextRef) createPDFContext:(CGRect)inMediaBox…
Joris Mans
  • 6,024
  • 6
  • 42
  • 69
7
votes
3 answers

iOS - How to draw a specific CGPath with unordered CGPoints

Consider this ASCII drawing: A _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ D | | | | | | | | | | | …
lobianco
  • 6,226
  • 2
  • 33
  • 48
7
votes
3 answers

Animating the drawing of a line

I'm trying to animate the drawing of a line by the following way: .h CAShapeLayer *rootLayer; CAShapeLayer *lineLayer; CGMutablePathRef path; .m path = CGPathCreateMutable(); CGPathMoveToPoint(path, nil, self.frame.size.width/2-100, 260); …
jkigel
  • 1,592
  • 6
  • 28
  • 49
6
votes
2 answers

NSView's Drawing Context

Is it safe to get a NSView's CGContext from -drawRect: and use it to later perform more drawing? In a simple test like this one: CGContextRef context = NULL; - (void)drawRect:(NSRect)r { if (!context) context = [[NSGraphicsContext…
winck
  • 1,024
  • 2
  • 10
  • 12
1 2
3
44 45