资讯

精准传达 • 有效沟通

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

vb.net绘画示例的简单介绍

vb.net桌面中bitmap类如何直接绘制到屏幕?

可以直接显示的。你看下面的示例,使用vb.net画的齿轮:

站在用户的角度思考问题,与客户深入沟通,找到达州网站设计与达州网站推广的解决方案,凭借多年的经验,让设计与互联网技术结合,创造个性化、用户体验好的作品,建站类型包括:网站设计制作、成都网站建设、企业官网、英文网站、手机端网站、网站推广、域名申请虚拟主机、企业邮箱。业务覆盖达州地区。

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

b = New Bitmap(PictureBox1.Width, PictureBox1.Height)

g = Graphics.FromImage(b)

'g.RotateTransform(90)

g.Clear(Color.White)

g.TranslateTransform(PictureBox1.Width / 2, PictureBox1.Height / 2)

g.ScaleTransform(1, -1)

'g.SmoothingMode = Drawing2D.SmoothingMode.AntiAlias

g.SmoothingMode = Drawing2D.SmoothingMode.HighQuality

DrawCL(g, New PointF(Val(TextBox1.Text), Val(TextBox2.Text)), Val(TextBox3.Text), Val(TextBox4.Text), Val(TextBox5.Text), Val(TextBox6.Text), Val(TextBox7.Text), Val(TextBox8.Text), Val(TextBox9.Text))

DrawCL(g, New PointF(Val(TextBox18.Text), Val(TextBox17.Text)), Val(TextBox16.Text), Val(TextBox15.Text), Val(TextBox14.Text), Val(TextBox13.Text), Val(TextBox12.Text), Val(TextBox11.Text), Val(TextBox10.Text))

PictureBox1.Image = b

End Sub

大佬们~VisualStudio中vb.net如何画三角函数图像?

VB系统的坐标原点在左上角,X轴的正方向是水平向右,而Y轴的正方向是垂直向下。所以,要绘制三角函数的曲线,自己可以通过改变点坐标的方法来实现,当然,VB.NET提供了相应的方法可以来实现坐标变换,也可以通过VB.Net的Graphics类提供的平移、旋转等转换来实现。

下面是我通过自己变换实现的示例,提供参考;我的环境是VB.NET 2010

Imports System.Math

Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

  '1,获得一个Graphics对象

  Dim MyGraphics As Graphics

  MyGraphics = PictureBox1.CreateGraphics

  '2,定义一个Pen对象,用于绘制图形(轮廓线)

  Dim MyPen As New Pen(Color.Black, 1)

  '3,定义一个Brush对象,用于填充图形(如果需要填充的话)

  Dim MyBrush As New SolidBrush(Color.Orange)

  MyGraphics.DrawLine(MyPen, 0, 200, 700, 200)

End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

  '1,获得一个Graphics对象

  Dim MyGraphics As Graphics

  MyGraphics = PictureBox1.CreateGraphics

  '2,定义一个Pen对象,用于绘制图形(轮廓线)

  Dim MyPen As New Pen(Color.Black, 1)

  '3,定义一个Brush对象,用于填充图形(如果需要填充的话)

  Dim MyBrush As New SolidBrush(Color.Orange)

  '声明横向和纵向比例变量

  Dim Heng As Integer = 20

  Dim Zong As Integer = 50

  '先获得正弦值,保存到点坐标数组

  Dim MyPoints(700) As Point

  Dim i As Integer

  For i = 0 To 700

      MyPoints(i) = New Point(i * Heng, 200 + Sin(i) * Zong)

  Next

  '采用绘制光滑线连接点的方式绘制曲线

  MyGraphics.DrawCurve(MyPen, MyPoints)

End Sub

End Class

显示的效果图:

VB.NET中怎样画圆弧

用Circle 画圆 圆弧 椭圆 都 具体参照面详细说明 Circle(一000,一000),500,吧,-陆,-三 一000,一000,圆坐标 500,半径 面别代表起始角,终止角,短轴比率 吧,详细点,Circle都说遍 象画圆、椭圆或弧 语 object.Circle [Step] (x, y), radius, [color, start, end, aspect] Circle 语象限定符部: 部 描述 object 选 象表达式其值应用于列表象object 省略具焦点窗体作object Step 选关键字 指定圆、椭圆或弧相于前 object CurrentX CurrentY 属性提供坐标 (x, y) 必需 Single (单精度浮点数)圆、椭圆或弧坐标object ScaleMode 属性决定使用度量单位 radius 必需Single (单精度浮点数)圆、椭圆或弧半径 object ScaleMode 属性决定使用度量单位 color 选Long (整型数)圆轮廓 RGB 颜色省略则使用 ForeColor 属性值用 RGB 函数或 QBColor 函数指定颜色 start, end 选 Single (单精度浮点数)弧、或部圆或椭圆画完start end 指定(弧度单位)弧起点终点位置其范围 -二 pi 二 pi 起点缺省值0; 终点缺省值二 * pi aspect 选 Single (单精度浮点数)圆纵横尺寸比缺省值 一.0何屏幕都产标准圆(非椭圆) 说明 想要填充圆使用圆或椭圆所属象 FillColor FillStyle 属性封闭图形才能填充封闭图形包括圆、椭圆、或扇形 画部圆或椭圆 start 负Circle 画半径 start并角度处理; end 负Circle 画半径 end并角度处理Circle 总逆针()向绘图 画圆、椭圆或弧线段粗细取决于 DrawWidth 属性值背景画圆取决于 DrawMode DrawStyle 属性值 画角度 0 扇形要画条半径(向右画水平线段)给 start 规定负值要给 0 .省略语间某参数能省略隔参数逗号您指定参数面逗号省略 Circle 执行CurrentX CurrentY 属性参数设置点 能用 With匛nd With 语句块 -------------------------------------------------------------------------------- Circle 示例 示例用Circle 窗体央画许同圆要运行示例代码放入窗体 General 部按 F5 并单击窗体 Sub Form_Click () Dim CX, CY, Radius, Limit ' Declare variable. ScaleMode = 三 ' 像素单位 CX = ScaleWidth / 二 ' X 位置 CY = ScaleHeight / 二 ' Y 位置 If CX CY Then Limit = CY Else Limit = CX For Radius = 0 To Limit ' 半径 Circle (CX, CY), Radius,RGB(Rnd * 二55, Rnd * 二55, Rnd * 二55) Next Radius End Sub -------------------------------------------------------------------------------

VB.net中如何画图?

VB.net与VB不同。

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绘画示例的简单介绍
文章网址:http://cdkjz.cn/article/ddoojis.html
多年建站经验

多一份参考,总有益处

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

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

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