画圆 圆心为(350,250)半径为200
Public Class Form1 Private Sub Form1_Paint(ByVal sender As Object,ByVal e As System.windows.Forms.PaintEventArgs) Handles Me.Paint Dim gr As Graphics = Me.CreateGraphics gr.DrawEllipse(Pens.Green,350,250,50,50) gr.dispose() End SubEnd Class
画椭圆 和窗体相同大的椭圆
Public Class Form1 Private Sub Form1_Paint(ByVal sender As Object,ByVal e As System.windows.Forms.PaintEventArgs) Handles Me.Paint Dim gr As Graphics = Me.CreateGraphics gr.DrawEllipse(Pens.Red,Me.ClIEntSize.WIDth,Me.ClIEntSize.Height) gr.dispose() End SubEnd Class
画椭圆 改 (跟随窗体大小改变)
Public Class Form1 Private Sub Form1_Resize(ByVal sender As Object,ByVal e As System.EventArgs) Handles Me.Resize Me.Refresh() '刷新 Dim gr As Graphics = Me.CreateGraphics gr.DrawEllipse(Pens.Red,Me.ClIEntSize.Height) gr.dispose() End SubEnd Class
画两点之间的线 例如 (100,30)到(500,300)之间的线
Public Class Form1 Private Sub Form1_Paint(ByVal sender As Object,ByVal e As System.windows.Forms.PaintEventArgs) Handles Me.Paint Dim gr As Graphics = Me.CreateGraphics gr.Drawline(Pens.Red,100,30,500,300) gr.dispose() End SubEnd Class
图片的水平和垂直翻转
Public Class Form1 Private Sub Form1_Paint(ByVal sender As Object,ByVal e As System.windows.Forms.PaintEventArgs) Handles Me.Paint Dim gr As Graphics = Me.CreateGraphics Dim img As Image = Image.Fromfile("C:\Users\lenovo\Downloads.jpg") gr.DrawImage(img,100) gr.DrawImage(img,220,-100) '垂直翻转 gr.DrawImage(img,230,-100,100) '水平翻转 gr.dispose() End SubEnd Class
绘制正方形
Public Class Form1 Private Sub Form1_Paint(ByVal sender As Object,ByVal e As System.windows.Forms.PaintEventArgs) Handles Me.Paint Dim gr As Graphics = Me.CreateGraphics gr.DrawRectangle(Pens.Red,130,300,300) gr.dispose() End SubEnd Class总结
以上是内存溢出为你收集整理的vb.net graphic类 画圆,椭圆 画两点之间的坐标 画窗体改变跟随画图 图片的水平垂直翻转全部内容,希望文章能够帮你解决vb.net graphic类 画圆,椭圆 画两点之间的坐标 画窗体改变跟随画图 图片的水平垂直翻转所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)