-1

I know that drawing a point by using drawing a line method in Quartz 2D is

CGContextMoveToPoint(context,x,y-0.5f);
CGContextAddLineToPoint(context,x,y+0.5f);

Is there any other possible way to draw a point using Quartz? I meant, some direct way of doing so?

Lithu T.V
  • 19,955
  • 12
  • 56
  • 101

2 Answers2

1
CGContextFillRect(context, CGRectMake(x,y,1,1));
danielbeard
  • 9,120
  • 3
  • 44
  • 58
Shashikanth
  • 752
  • 5
  • 13
0

if you want it to look like a circular point try this:

CGContextStrokeEllipseInRect(context, CGRectMake(x, y, 4, 4));

it will draw for you you a an ellipse inside a rectangle (above case is apparently a square). i prefer you to choose a square as it will look like a real circle and not oval one. however, this circle will be empty from the inside, you can fill it by a stroke. (but it looks cool like a donut!) :)

HusseinB
  • 1,321
  • 1
  • 17
  • 41