坐标系改变后文字正常写入,临时修改graphics

    public void DrawText(Graphics g, Pen blackPen, float fFontHeight)
    {
      SolidBrush mybrush = new SolidBrush(Color.White);
      Font myfont = new Font("黑体", fFontHeight);
      PointF mypointf = new PointF();
      mypointf.X = (float)(PtEnd.X + fFontHeight);
      mypointf.Y = -((float)(PtEnd.Y)+ fFontHeight / 4 * 3);
      GraphicsState gs = g.Save();
      g.ScaleTransform(1f, -1f);
      g.DrawString(Count.ToString(), myfont, mybrush, mypointf);
      g.Restore(gs);
    }

猜你喜欢

转载自www.cnblogs.com/swtool/p/9327239.html
今日推荐