How do I draw a point using Core Graphics?
Quartz is not a pixel-oriented API, and its contexts aren’t necessarily pixel buffers. If you want to draw pixmaps, create a bitmap context with CGBitmapContextCreate()
. You provide a buffer, which you can manipulate directly, and can copy to another context by creating a CGImage
from the same buffer using CGImageCreate()
and drawing that.
Draw a very small ellipse/circle and fill it!
CGContextAddEllipseInRect(Context,(CGRectMake (x_dot, y_dot, 3.0, 3.0));CGContextDrawPath(Context, kCGPathFill);CGContextStrokePath(Context);
I am using this code to create a small dot (3x3 pixels) in a dotted music note.