-- 作者:漂亮美眉vszh
-- 发布时间:2017/9/3 16:36:00
--
Dim i As Integer = r("动力得分合计") / (r("动力得分合计") + r("阻力得分合计")) *1000 Dim i1 As Integer = r("阻力得分合计") / (r("动力得分合计") + r("阻力得分合计")) *1000 Dim p As WinForm.Painter = e.Form.Controls("Painter1") Dim g As Graphics = p.Graphics Dim n As New Pen(Color.green,5) g.DrawLine(N,100,100,i,100) Dim fnt As New Font("宋体",16) Dim msg As String = "动力" g.DrawString(msg,fnt,Brushes.green,50,90) p.Repaint() Dim p1 As WinForm.Painter = e.Form.Controls("Painter1") Dim g1 As Graphics = p1.Graphics Dim n1 As New Pen(Color.red,5) g1.DrawLine(N1,100,200,i1,200) Dim fnt1 As New Font("宋体",16) Dim msg1 As String = "阻力" g1.DrawString(msg1,fnt1,Brushes.red,50,190) p1.Repaint()
|
-- 作者:有点甜
-- 发布时间:2017/9/3 16:56:00
--
绘画之前,要先把Painter的宽高设置成最大,然后绘画,然后设置回适合你页面的大小。
如代码
Dim p As WinForm.Painter = e.Form.Controls("Painter1") p.dock = 0 p.width = 10000 Dim g As Graphics = p.Graphics g.DrawLine(Pens.Red,30,0,30,60) g.DrawLine(Pens.Red,0,30,60,30) p.Repaint()
|