-- 作者:程兴刚
-- 发布时间:2012/4/28 11:37:00
--
代码:
If e.Col.Name = "工艺图" Then Dim g As Graphics = e.Graphics Dim pn As New Pen(Color.red,2) Dim pn1 As New Pen(Color.LightGray,1) Dim fnt As New Font("宋体",8,FontStyle.Regular) e.StartDraw() Dim w,h,rx,ry,x,y As Single h = e.Row("长度") w = e.Row("宽度") \'长方形宽 g.DrawRectangle(pn,e.x+35,e.y+15, 200, 60) \'绘制长方形 \'绘制角线 g.DrawLine(Pens.Green,e.x+40,e.y+20,e.x+50,e.y+20) g.DrawLine(Pens.Green,e.x+40,e.y+20,e.x+40,e.y+30) g.DrawLine(Pens.Green,e.x+40,e.y+70,e.x+50,e.y+70) g.DrawLine(Pens.Green,e.x+40,e.y+60,e.x+40,e.y+70) g.DrawLine(Pens.Green,e.x+220,e.y+20,e.x+230,e.y+20) g.DrawLine(Pens.Green,e.x+230,e.y+20,e.x+230,e.y+30) g.DrawLine(Pens.Green,e.x+220,e.y+70,e.x+230,e.y+70) g.DrawLine(Pens.Green,e.x+230,e.y+60,e.x+230,e.y+70) g.DrawString(h,fnt,Brushes.RoyalBlue,130+e.x,2+e.y) g.DrawString(w,fnt,Brushes.RoyalBlue,2+e.x,40+e.y) e.EndDraw() End If
效果图:
此主题相关图片如下:未命名.jpg
|