VB.NET怎么在屏幕上画一个逐渐变大的空心圈?在窗体上拉一个Timer控件,enabled设为true,Interval设为20 。完整代码如下:Dim myPen As New System.Drawing.Pen(System.Drawing.Color.Red)
Dim formGraphics As System.Drawing.Graphics
Dim num As Integer = 1
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Me.Refresh() '清屏
formGraphics = Me.CreateGraphics()
formGraphics.DrawEllipse(myPen, New Rectangle(100, 100, num, num)) '在坐标(100,100)的位置画圆
If num200 Then'如果大于200则停止画圆
myPen.Dispose()
formGraphics.Dispose()
Timer1.Enabled = False
Else
num = num1
End If
End Sub
vb.net 如何实现在drawpanel中画图显示后复制显示在picturebox上?请具体说明drawpanel是什么东东 , 自定义控件吗?如果类似于picturebox,使用
'自动重绘要设为True,如果有这个属性的话
DrawPanel.AutoRedraw = True
'保存到变量
Image img = DrawPanel.Image
'直接设置Image属性即可
PictureBox1.Image = img
求大神指点 vb.net 怎么绘制一张有文字的图呢?并用 PictureBox1 显示出来Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim nBrush As New SolidBrush(Color.Red)
Dim font As New Font("宋体", 12)
Dim bmp As Bitmap = Bitmap.FromFile("c:\123.jpg")
Dim info As String = "完成"
Dim g As Graphics = Graphics.FromImage(bmp)
Dim sizef As SizeF = g.MeasureString(info, font)
Dim left As Single = (PictureBox1.Width - sizef.Width) / 2
Dim top As Single = (PictureBox1.Height - sizef.Height) / 2
g.DrawString(info, font, nBrush, left, top)
g = PictureBox1.CreateGraphics
g.DrawImage(bmp, 0, 0)
g = Nothing
bmp = Nothing
End Sub
VB.net中如何画图?分类:电脑/网络程序设计其vb.net系统屏幕画图他编程语言
问题描述:
VB6中vb.net系统屏幕画图的form1.circle (100,200),rgb(0,255,0)的语句如何在VB中使用啊vb.net系统屏幕画图?
急用啊vb.net系统屏幕画图?。。。。。。。?
解析:
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桌面中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
【vb.net系统屏幕画图 vb绘图程序代码】vb.net系统屏幕画图的介绍就聊到这里吧,感谢你花时间阅读本站内容,更多关于vb绘图程序代码、vb.net系统屏幕画图的信息别忘了在本站进行查找喔 。
推荐阅读
- 摆件饰品直播卖货怎么样,直播卖小饰品
- sqlserver修改数据语句怎么写,sqlserver 修改数据
- js获取字符串前5位,js取字符串的前两位
- 安卓大型单机动作游戏,安卓单机大型游戏排行榜
- java中js代码 java运行js代码
- 提示安装netframe,提示安装新的碳粉盒
- PYTHON教程视频调色的简单介绍
- u盘进入pe系统怎么安装,通过u盘进入pe系统盘
- vb.net屏幕分辨率 vbox分辨率改为1080