vb.net图示的简单介绍

VB.net中如何画图?

VB.net与VB不同。

我们提供的服务有:网站设计制作、成都网站设计、微信公众号开发、网站优化、网站认证、巴州ssl等。为上千余家企事业单位解决了网站和推广的问题。提供周到的售前咨询和贴心的售后服务,是有科学管理、有技术的巴州网站制作公司

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绘制曲线图

。net  其实还是很好绘制图形的

你可以看下 Graphics  类

Dim d As New Bitmap(Me.Width, Me.Height)  ‘一个图片吧

  Dim g As Graphics = Graphics.FromImage(d)’绘制  准备在这个图片是进行

然后  就是你绘制的东西了

线 就是   g.DrawLine()

圆 弧度  就用  g.DrawArc(Pens.Black, New Rectangle(0, 0, 400, 200), 0, 360)

复杂的就是      g.DrawBezier()

等  如果你用的是 VS的  编译  上面都有详细的参数说明

Dim d As New Bitmap(Me.Width, Me.Height)

Dim g As Graphics = Graphics.FromImage(d)

g.DrawArc(Pens.Black, New Rectangle(0, 0, 200, 200), 0, 360)

g.DrawLine(Pens.Red, New Point(0, 0), New Point(200, 200))

g.DrawLines(Pens.Green, New Point() {New Point(0, 0), New Point(50, 40), New Point(50, 80), New Point(90, 70), New Point(100, 400)})

g.DrawBezier(Pens.Yellow, New Point(0, 100), New Point(0, 0), New Point(200, 0), New Point(200, 200))

g.Dispose()

Me.BackgroundImage = d

用vb.net实现查找显示图片?

IO.Directory.GetFiles

获取指定目录中的所有文件,比对文件名就行了。如果包括多层子目录,需要递归

vb.net中,如何像下图一样,用很简单的办法,导入1000张图片。

很简单的方法,貌似没有。这个需要自己写很多代码:

用一个ListView控件。

判断滚动条当前所显示的图片集合,获取它们的物理路径。

用Bitmap.FromImage方法把这些图片读出来,

然后获取缩略图,

把缩略图用Graphics.DrawImage()绘制出来。

我可以提供Bitmap如何获取缩略图的方法:

''' summary必须创建一个委托并将对此委托的引用作为获取缩略图 callback 参数传递,但不使用此委托。/summary

Public Function ThumbnailCallback() As Boolean

Return False

End Function

''' summary返回Image,表示图像指定 宽 和 高 的缩略图。/summary

Public Function 获取缩略图(位图 As Bitmap, 宽 As Integer, 高 As Integer) As Image

Dim myCallback As New Image.GetThumbnailImageAbort(ThumbnailCallback)

Return 位图.GetThumbnailImage(宽, 高, myCallback, IntPtr.Zero)

End Function


网页题目:vb.net图示的简单介绍
转载源于:http://myzitong.com/article/docgioj.html