How to draw a subpixel line

前端 未结 5 2661
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-19 22:27

In the following code, I\'m trying to draw two lines: One with a subpixel width (0.5) and the other with 1px width:

        var img = new Bitmap(256, 256);
              


        
5条回答
  •  忘掉有多难
    2021-02-19 23:22

    According to the documentation for Pen ,

    The Width property is set to the value specified in the width parameter. A width of 0 will result in the Pen drawing as if the width were 1.

    It may be that that applies to any width less than one, not just widths that are precisely equal to 0.

提交回复
热议问题