How do I draw a point using Core Graphics?

前端 未结 7 1951
别那么骄傲
别那么骄傲 2020-12-03 07:57

I see APIs in Quartz for drawing lines and circles. But all I want to do is to specify the (x,y) cartesian coordinate to color a pixel a particular value. How do I do that

7条回答
  •  有刺的猬
    2020-12-03 08:22

    I got a point (zero length line) to draw after setting the line-caps to kCGLineCapRound. The default line-cap has no length so can't be drawn.

    The argument that a point has no size is silly. The lines have no width but we can draw those (by using the "line width" from the draw state). A point should draw in exactly the same way, and with different line caps I believe it does.

    Maybe this behavior is new?

提交回复
热议问题