vb.net画图 vbnet画图

vb.net画图控件如何画三角网图形?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
VB.net绘图具体如何设置双缓冲VB.NET画图是不能设置双缓冲的,双缓冲是指窗体,从来没说是针对控件 。
不用graphic.clear清理重画就不会闪烁 。你可以先把容器删了再重新建立一个再去画 。
简单举例:
Graphics g;
Pen p;
Panel pl;
【vb.net画图 vbnet画图】构造函数初始化:
p=new Pen(Color.Red,2);
pl=panel1;
造成闪烁的画法:
g=pl.CreateGraphics();
g.Clear(SystemColor.ButtonFace);
//.....画新的
不会闪烁的办法:
this.Controls.ReMoveAt(panel1);
pl=new Panel();
pl.Name="panel1";
//....创建容器控件
this.Controls.Add(pl);
//继续画
VB.net中如何画图?分类:电脑/网络程序设计其他编程语言
问题描述:
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.net 画图 如何保持图形不用PictureBoxTest.Image属性vb.net画图,直接把图形绘制到PictureBoxTest上面就可以vb.net画图了 。
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.net怎样在当前已打开的AutoCAD画图? 最好有个判断语句, 如果CAD已打开, 在当前画图; 如果没有, 则打开Private Function isopen() As AutoCAD.AcadApplication
Try
dimCADapp_tempAutoCAD.AcadApplication = GetObject(, "AutoCAD.Application")
return CADapp_temp
Catch ex As Exception
Return Nothing
End Try
End Function
'调用上面的函数,如果为nothing表示没有打开 , 否则打开并返回对象
vb.net画图的介绍就聊到这里吧 , 感谢你花时间阅读本站内容,更多关于vbnet画图、vb.net画图的信息别忘了在本站进行查找喔 。

    推荐阅读