快上网专注成都网站设计 成都网站制作 成都网站建设
成都网站建设公司服务热线:028-86922220

网站建设知识

十年网站开发经验 + 多家企业客户 + 靠谱的建站团队

量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决

vb点虐 画图像 vbnet图像处理

VB点虐 中如何画图?

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

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

问题描述:

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绘制GDI图形

下面的例子通过重载Form 窗体的OnPaint()方法绘制GDI图形Protected Overrides Sub onpaint(ByVal e As System Windows Forms PaintEventArgs)注释 /////////////绘制任意直线Dim g As Graphics = e GraphicsDim mypen As Pen = New Pen(Color Red )g DrawLine(mypen )注释 /////////////绘制矩形(任意直线构成的封闭图形)Dim point As PointF = New PointF( F F)Dim point As PointF = New PointF( F F)Dim point As PointF = New PointF( F F)Dim point As PointF = New PointF( F F)Dim curvepoints As PointF() = {point point point point }g DrawPolygon(New Pen(Color Blue ) curvepoints)注释 ////////////文本表示Dim FFamily As FontFamily = New FontFamily( Arial )Dim font As Font = New Font(FFamily FontStyle Bold FontStyle Italic GraphicsUnit Pixel)Dim text As String = I love you! Dim solidbrush As SolidBrush = New SolidBrush(Color Red)Dim pr As PointF = New PointF( )e Graphics DrawString(text font solidbrush pr)注释拦橘 ////////////平面绘制燃差Dim rec As RectangleF = New RectangleF( )g DrawPie(mypen rec )注释 ///////////封闭图形 应该是个圆g DrawClosedCurve(mypen curvepoints Drawing Drawing D FillMode Alternate)注释 ///////////大家自己试试看吧g DrawArc(mypen )g DrawCurve(mypen curvepoints)g DrawBezier(mypen )g DrawBeziers(mypen curvepoints)注释 //////////这可是一个圆Dim rec As RectangleF = New RectangleF( )g DrawEllipse(mypen rec )注释 //////////这是一个椭圆简段团Dim rec As RectangleF = New RectangleF( )g DrawEllipse(mypen rec )End Sub 这些是我自己试验出来的 当然了 还有好多 我只是开了一个头 大家要是发现什么好东东 别忘了通知一下 ) lishixinzhi/Article/program/net/201311/11800

Vb点虐 怎么实现图像的处理

这问题有点笼统,软旁迹胡糖来说说把:

图像处理由System.Drawing命名空间负责。

主要是Bitmap类和Graphics类。

Bitmap表示一个位图,可以是BMP,JPG,PNG等文件。

装载位图

Dim 位图 As Bitmap = Bitmap.FromFile("C:\Image1.PNG")

Graphics表示一州悔张画纸,能够进行绘制操作。

它可以被窗体、控件、位图调用CreateGraphics()方法来创建。

然后调用Graphics.Draw开头的一系列函数来绘制图像和图形,Fill开头的填充图形。

创建画纸并绘制位图

Dim 画纸 As Graphics = Me.CreateGraphics()

画纸.DrawImage(位图, 100, 100, 256, 256)

可以将上面三行放到Form1_Load中测试运拦,把路径改一下,

还可以把Me改为能在上面绘图的控件的名称。

更多内容请看MSDN的System.Drawing命名空间。

如满意,请采纳,谢谢。


新闻标题:vb点虐 画图像 vbnet图像处理
网页URL:http://6mz.cn/article/ddpgihc.html

其他资讯