How do I draw a point using Core Graphics?

前端 未结 7 2080
别那么骄傲
别那么骄傲 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:27

    I'm having the same issue - i find the best solution is similar to the last, but at least it doesn't leave something that looks like a "dash"... of course, should ensure x/y are both > 0.

    CGContextFillRect(context, CGRectMake(x - 0.5, y - 0.5, 1.0 , 1.0));

提交回复
热议问题