'添加模块一个模块声明如下APIPublic Declare Function GdiTransparentBlt Lib "gdi32" (ByVal hdc1 As Long, ByVal x1 As Long, ByVal y1 As Long, ByVal W1 As Long, ByVal H1 As Long, ByVal Hdc2 As Long, ByVal X2 As Long, ByVal Y2 As Long, ByVal W2 As Long, ByVal H2 As Long, ByVal Color As Long) As Long'hdc1 要绘图目标句柄'x1图片显示的横坐标位置'y1图片显示的纵坐标位置'w1图片缩放比例宽度'h1图片缩放比例高度'hdc2要绘制透明色的图片或控件(这里指picture)'x2一般这里填0(图片左上角起始坐标)'y2一般这里填0(图片左上角起始坐标)'w2图片宽度'h2图片高度'color绘制颜色(RGB(255,255,255)为透明色)'picture控件属性设置成visible=falseautosize=trueautoredraw=trueborderstyle=0窗体autoredraw=true简单例子Private Sub Form_Load()GdiTransparentBlt form1.hDC, 0, 0, form1.picture1.Width, form1.picture1.Height, form1.picture1.hDC, 0, 0, form1.picture1.Width, form1.picture1.Height, RGB(255, 255, 255) '画图End Sub
我们提供的服务有:成都网站设计、做网站、微信公众号开发、网站优化、网站认证、涞水ssl等。为数千家企事业单位解决了网站和推广的问题。提供周到的售前咨询和贴心的售后服务,是有科学管理、有技术的涞水网站制作公司
微软上有Microsoft Chart控件的示例程序,非常详细,一看就会。
但我微软站上的刚没找到,这里找到一个
Imports System.Drawing
Imports System.Drawing.Drawing2D
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim g As Graphics = PictureBox1.CreateGraphics
Dim hs As HatchStyle = HatchStyle.Cross
Dim sb As HatchBrush = New HatchBrush(hs, Color.Black, Color.White)
Dim p(3) As Point
p(0).X = 100
p(0).Y = 50
p(1).X = 0
p(1).Y = 100
p(2).X = 200
p(2).Y = 100
p(3).X = 100
p(3).Y = 50
g.FillPolygon(sb, p)
g.DrawPolygon(Pens.Black, p)
End Sub
End Class
记得VB6当中有Shape控件,但是VB.net里这个控件不存在了。
提个思路:使用Picture控件或Label控件,通过代码在控件里绘图想要的图形,可以试试。
售后响应及时
7×24小时客服热线数据备份
更安全、更高效、更稳定价格公道精准
项目经理精准报价不弄虚作假合作无风险
重合同讲信誉,无效全额退款