Questions tagged [cgcontextdrawpath]
8 questions
6
votes
1 answer
How to zoom graph, created with CGContextRef
I am drawing a line graph by using CGContextRef. Can I zoom in zoom out this graph to show lines clearly.
I am using this code.
CGContextRef context=UIGraphicsGetCurrentContext();
CGContextBeginPath(context);
CGMutablePathRef…

Mayank Jain
- 5,663
- 7
- 32
- 65
1
vote
0 answers
CGContext strokes lags when scaled compared to the default scale value
I'm working on a simple freehand drawing app. Below is the sample code, I'm using the UIGesture class to track the scribble, i.e., pencil or finger movement, and then stroking those touch points on the UIImageView, the stroke edges are blurry hence…

Raj Kiran
- 152
- 1
- 9
1
vote
2 answers
Using drawRect to draw & animate two graphs. A background graph, and a foreground graph
I am using drawRect to draw a pretty simple shape (dark blue in the image below).
I'd like this to animate from the left to the right, so that it grows. The caveat here is I need there to be a "max" background in gray, as seen in the top part of…

Joe
- 3,772
- 3
- 33
- 64
1
vote
2 answers
CoreGraphics in iOS: how can I save the paths drawn in a CGContext and retrieve them in the next draw call?
EDIT:
What I am trying to achieve is skip the call to firstDraw() the second time that drawRect is called. Reason for this is that in my real code I have got a lot of data points and lines to draw, so I thought thata if I recycle the previously…

mm24
- 9,280
- 12
- 75
- 170
0
votes
0 answers
CGContext strokepath makes edges of stroke blurred
I'm working on a simple freehand drawing app. Below is the sample code, I'm using the UIGesture class to track the scribble, i.e., pencil or finger movement, and then stroking those touch points on the UIImageView
let previousLocation =…

Raj Kiran
- 152
- 1
- 9
0
votes
1 answer
Draw dashed line in iOS
I used CGContext to draw dashed lines in iOS.
My code is as follow.
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetStrokeColorWithColor(context, [UIColor redColor].CGColor);
CGFloat dashes[] = {5,5};
CGContextSetLineDash(context,…

batuman
- 7,066
- 26
- 107
- 229
0
votes
1 answer
CGContext draw 45 degree line joint
Is there any way to draw lines in CGContext which connected with each other with 45 degree angle, like this picture shows:

Mark
- 15
- 1
- 6
0
votes
1 answer
CGContextDrawPath only strokes and does not fill
I am trying to make a shape that strokes and fills but it does not fill.
Here is my code:
- (void)drawLayer:(CALayer *)layer inContext:(CGContextRef)ctx
{
CGMutablePathRef pathRef = CGPathCreateMutable();
CGContextBeginPath(ctx);
…

Wyetro
- 8,439
- 9
- 46
- 64