vb.net在控件上绘图 c#绘图控件

VB.net中如何画图?

VB.net与VB不同。

创新互联技术团队10余年来致力于为客户提供网站建设、网站设计成都品牌网站建设全网营销推广、搜索引擎SEO优化等服务。经过多年发展,公司拥有经验丰富的技术团队,先后服务、推广了数千家网站,包括各类中小企业、企事单位、高校等机构单位。

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中的webbrowser控件中绘图

webbrowser是不断刷新的。就算你绘了图,那个位置马上又被刷新为原来的样子,所以此路不通。

可不可以这样变通:

把你的图片制作好,然后在htm文件中引用它,最后通过webbrowser显示。

vb.net在100个picturebox控件上画同样的图,有什么简便的方法没,除了复制100遍代码

我做了一个示例,在3*4的picturebox上画圆,你可以通过该参数来达到100个圆。

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

For j As Integer = 0 To 2

For i As Integer = 0 To 3

Dim nPic As New PictureBox

With nPic

.Size = New Size(100, 100)

.Location = New Point(i * 150 + 20, j * 150 + 20)

.ImageLocation = "C:\Users\Xiansr\Pictures\丝绸\20121142591274218.jpg"

.Load()

End With

Me.Controls.Add(nPic)

Dim gm As Graphics = Graphics.FromImage(CType(Me.Controls.Item(i + (j * 4)), PictureBox).Image)

gm.DrawArc(Pens.White, 25, 25, 50, 50, 0, 360)

Next

Next

End Sub


新闻名称:vb.net在控件上绘图 c#绘图控件
标题来源:http://ybzwz.com/article/docsgse.html