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
10
votes
2 answers

Clipping a CALayer to arbitrary path

Is it possible to clip a CALayer to an arbitrary path? I am aware that I can clip to the superlayer's bounds, but in this case I need to be far more prescriptive. TIA, Adam
apchester
  • 1,154
  • 3
  • 11
  • 30
10
votes
1 answer

iPhone SDK Erase A UIImageView from the Screen Using Touches?

I am looking for a way of being able to erase a UIImageView from the screen. When I say erase I don't mean [imageView removeFromSuperview];, I mean to erase parts of the image by scribbling your finger on the screen. Where ever your finger is, that…
Alec
  • 177
  • 2
  • 16
10
votes
3 answers

How can I check if a user tapped near a CGPath?

Scenario: I have a set of CGPaths. They are mostly just lines (i.e. not closed shapes). They are drawn on the screen in a UIView's draw method. How can I check if the user tapped near one of the paths? Here's what I had…
Ed Marty
  • 39,590
  • 19
  • 103
  • 156
10
votes
5 answers

How to add shadow to a transparent UIView?

How can I reproduce this shadowing? My problem, that if I use high alpha color or clearColor, there is no drop shadow, if I use low alpha color, I can't see the drop shadow under the plate. As the level of the volume is changing (colorful part) the…
János
  • 32,867
  • 38
  • 193
  • 353
10
votes
1 answer

CGContextClipToMask returning blank image

I'm new to Quartz. I have 2 images, a background, and a mask with cutout shape that I want to lay over the background in order to cut out a section. The resulting image should be the shape of the cutout. This is my mask (the shape in the middle is 0…
Smikey
  • 8,106
  • 3
  • 46
  • 74
9
votes
2 answers

How to determine and interpret the pixel format of a CGImage

I'm loading this (very small) image using: UIImage* image = [UIImage named:@"someFile.png"]; The image is 4x1 and it contains a red, green, blue and white pixel from left to right, in that order. Next, I get the pixel data out of the underlying…
Matt Comi
  • 610
  • 6
  • 9
9
votes
2 answers

Is there a way to draw a CGContextDrawRadialGradient as an oval instead of a perfect circle?

I need a radial gradient in the shape of an oval or ellipse and it seems like it CGContextDrawRadialGradient can only draw a perfect circle. I've been drawing to a square context then copying/drawing into a rectangular context. Any better way to do…
Ray
  • 109
  • 1
  • 3
9
votes
2 answers

UIView with shadow

I'm trying to create a shadow around a simple UIView object which is added on top of a UIViewController's view. what's the most straight forward way of doing this?
zumzum
  • 17,984
  • 26
  • 111
  • 172
9
votes
2 answers

Draw dotted lines using Quartz on iPhone

I am developing an application in which I need to draw dotted lines between a couple of points. I tried CGContextSetLineCap(UIGraphicsGetCurrentContext(), kCGLineCapRound) CGContextSetLineDash(UIGraphicsGetCurrentContext(), 0, lengths,…
kayvee
  • 93
  • 1
  • 6
9
votes
2 answers

CGPath with outline

I am trying to draw a CGPath that has a stroke for it's stroke. Basically I want a draw a line using CGPath. I then want to go back and draw lines on both sides of the last CGPath giving it the effect that it is outlines. This line can bend and…
endy
  • 3,872
  • 5
  • 29
  • 43
9
votes
4 answers

How to draw a shape on top of a UIImage while respecting the image's alpha mask

I need a UIImageView that can draw itself in color or b/w according to a flag: BOOL isGrey; I'm trying to do it by drawing a black rectangle on top of the original image with the Quartz blendmode set to Color. This works except it doesn't respect…
willc2
  • 38,991
  • 25
  • 88
  • 99
9
votes
2 answers

On iOS, what is the fastest way to cache a drawn screen image and display it?

Instead of letting drawRect redraw thousands of point every time, I think there are several ways to "cache the image on screen" and any additional drawing, we will add to that image, and just show that image when it is time to drawRect: Use…
Jeremy L
  • 3,770
  • 6
  • 41
  • 62
9
votes
1 answer

Redrawing custom CALayer subclass on custom property change

I am trying to build a special layer which draws text. This TWFlapLayer has an attributed string as a property: TWFlapLayer.h: @interface TWFlapLayer : CALayer @property(nonatomic, strong) __attribute__((NSObject)) CFAttributedStringRef…
GorillaPatch
  • 5,007
  • 1
  • 39
  • 56
8
votes
3 answers

Emboss effect in Core Graphics

I am again here with two Question, both inter-related I want to draw embossed lines with core graphics. Can any one suggest me how to give inner shadows to line drawn on touch events? Even for drawing outer shadows. Shadow drawn overlaps in…
DivineDesert
  • 6,924
  • 1
  • 29
  • 61
8
votes
1 answer

Can CARemoteLayerServer and CARemoteLayerClient be used between processes?

In Mac OS X Lion CARemoteLayerServer and CARemoteLayerClient were added to QuartzCore. I've been trying to investigate if they'd be suitable for splitting a graphical application between multiple processes, but without success. I can use them…
Michael
  • 1,355
  • 2
  • 12
  • 15