资讯

精准传达 • 有效沟通

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

vb点虐 画图 vb6画图

VB点虐 中如何画图?

分类: 电脑/网络 程序设计 其他编程语言

成都创新互联公司-成都网站建设公司,专注做网站、网站建设、网站营销推广,申请域名,网络空间,网站托管有关企业网站制作方案、改版、费用等问题,请联系成都创新互联公司

问题描述:

VB6中的form1.circle (100,200),rgb(0,255,0)的语句如何在VB中使用啊?

急用啊!!!!!!!!

解析:

VB与VB不同。

VB已经有专门绘图的类。

可以定义笔刷然后用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点虐 怎样在当前已打开的AutoCAD画图? 最好有个判断语句, 如果CAD已打开, 在当前画图; 如果没有, 则打开

Private Function isopen() As AutoCAD.AcadApplication

Try

dim CADapp_temp AutoCAD.AcadApplication = GetObject(, "AutoCAD.Application")

return CADapp_temp

Catch ex As Exception

Return Nothing

End Try

End Function

'调用上面的函数,如果为nothing表示没有打开,否则打开并返回对象

vb点虐 画图 如何保持图形

不用PictureBoxTest.Image属性,直接把图形绘制到PictureBoxTest上面就可以了。

Dim button As Integer = 0

Private Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) _

Handles Button1.Click

Using g As Graphics = Graphics.FromHwnd(PictureBoxTest.Handle)

Dim penRed As Pen = New Pen(Color.Red, 1)     '定义红色画笔  

Dim penblue As Pen = New Pen(Color.Blue, 1) '定义蓝色画笔 

If button = 0 Then

g.DrawLine(penRed, 0, 0, 100, 100)

button = 1

ElseIf button = 1 Then

g.DrawLine(penblue, 100, 100, 200, 200)

button = 0

End If

End Using

End Sub


网站名称:vb点虐 画图 vb6画图
分享URL:http://cdkjz.cn/article/ddspijo.html
多年建站经验

多一份参考,总有益处

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

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

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