资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

vb.net涂鸦 visual basic画图

VB.net中如何画图?

VB.net与VB不同。

溧水网站制作公司哪家好,找成都创新互联!从网页设计、网站建设、微信开发、APP开发、成都响应式网站建设公司等网站项目制作,到程序开发,运营维护。成都创新互联从2013年成立到现在10年的时间,我们拥有了丰富的建站经验和运维经验,来保证我们的工作的顺利进行。专注于网站建设就选成都创新互联

VB.net已经有专门绘图的类。

可以定义笔刷然后用Drawing类中的方法绘制。

Private Sub DrawEllipse()

Dim myPen As New System.Drawing.Pen(System.Drawing.Color.Red)

Dim formGraphics as System.Drawing.Graphics

formGraphics = Me.CreateGraphics()

formGraphics.DrawEllipse(myPen, New Rectangle(0,0,200,300))

myPen.Dispose()

formGraphics.Dispose()

End Sub

Private Sub DrawRectangle()

Dim myPen As New System.Drawing.Pen(System.Drawing.Color.Red)

Dim formGraphics as System.Drawing.Graphics

formGraphics = Me.CreateGraphics()

formGraphics.DrawRectangle(myPen, New Rectangle(0,0,200,300))

myPen.Dispose()

formGraphics.Dispose()

End Sub

VB.NET怎么重绘?

新建一个Winform,在和Form1平行的位置粘贴如下代码

Public Class MyLabel

Inherits Label

Protected Overrides Sub OnPaint(e As PaintEventArgs)

e.Graphics.DrawEllipse(New Pen(Color.Red), New Rectangle(2, 2, 10, 10))

MyBase.OnPaint(e)

End Sub

End Class

运行,停掉,在工具箱找到MyLabel,拖动就可以看到效果。这只是最基本的重写,要模仿QQ还需要其他技术以及美工。

vb.net中picturebox.paint和panel.paint的区别

Private Sub PictureBox1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles PictureBox1.Paint

e.Graphics.DrawRectangle(New Pen(Color.Red), 0, 0, 10, 10)

End Sub

Private Sub Panel1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Panel1.Paint

e.Graphics.DrawRectangle(New Pen(Color.Red), 0, 0, 10, 10)

End Sub

事实证明 都是有效果的 除非你代码有问题


本文题目:vb.net涂鸦 visual basic画图
文章网址:http://cdkjz.cn/article/dddedog.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

业务热线:400-028-6601 / 大客户专线   成都:13518219792   座机:028-86922220