资讯

精准传达 • 有效沟通

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

vb.net图片描边 vb如何在图像框中加图片

VB.net中如何在picturebox画线,有什么函数?

Dim b As New Bitmap(PictureBox1.Width, PictureBox1.Height)

创新互联公司长期为1000多家客户提供的网站建设服务,团队从业经验10年,关注不同地域、不同群体,并针对不同对象提供差异化的产品和服务;打造开放共赢平台,与合作伙伴共同营造健康的互联网生态环境。为二七企业提供专业的成都做网站、网站建设,二七网站改版等技术服务。拥有十年丰富建站经验和众多成功案例,为您定制开发。

Dim g As Graphics = Graphics.FromImage(b)

g.Clear(Color.White)

Dim p As New Pen(Color.Black)

p.EndCap = Drawing2D.LineCap.ArrowAnchor

g.DrawLine(p, 30, PictureBox1.Height - 30, 30, 30)

g.DrawLine(p, 30, PictureBox1.Height - 30, PictureBox1.Width - 30, PictureBox1.Height - 30)

Dim i As Integer

Dim bs As New SolidBrush(Color.Green)

Dim po As New Point

po.X = 0

po.Y = PictureBox1.Height - 35

For i = 700 To 1000 Step 50

g.DrawString(i, Me.Font, bs, po.X, po.Y)

g.DrawLine(p, po.X + 28, po.Y + 5, po.X + 30, po.Y + 5)

po.Y -= (PictureBox1.Height - 100) / 6

Next

po.X = 30

po.Y = PictureBox1.Height - 30

For i = 0 To 40 Step 5

g.DrawString(i, Me.Font, bs, po.X, po.Y + 5)

g.DrawLine(p, po.X, po.Y + 2, po.X, po.Y)

po.X += (PictureBox1.Width - 100) / 8

Next

PictureBox1.Image = b

vb.net画一个矩形图片的代码

g = Me.picDisplay.CreateGraphics

Dim mybrush As Brush = New SolidBrush(Map_Empty_Color)

Dim rect2 As System.Drawing.Rectangle = New System.Drawing.Rectangle(0, 0, Map_Width, Map_Height)

g.FillRectangle(mybrush, rect2)

vb.net中picturebox.paint和panel.paint的区别

Private Sub PictureBox1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles PictureBox1.Paint

e.Graphics.DrawRectangle(New Pen(Color.Red), 0, 0, 10, 10)

End Sub

Private Sub Panel1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Panel1.Paint

e.Graphics.DrawRectangle(New Pen(Color.Red), 0, 0, 10, 10)

End Sub

事实证明 都是有效果的 除非你代码有问题

Vb.net怎么实现图像的处理

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

图像处理由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.net图片描边 vb如何在图像框中加图片
本文路径:http://cdkjz.cn/article/dojihgd.html
多年建站经验

多一份参考,总有益处

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

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

大客户专线   成都:13518219792   座机:028-86922220