vb.net图片描边 vb中图片框

VB.NET求帮忙!...新建窗体 , 把maximizebox属性和MinimizeBox 属性设为false,再添加一个Label1放置文字一个Picturebox1放图片 。
在窗体的load事件中:
Private Sub Form1_Load() Handles Me.Load
Text="我的VB.NET程序"
PuctureBox1.Image=Image.FromFile(图片路径如e:\pic.jpg)
End Sub
窗体Click事件:
Private Sub Form1_Click() Handles Me.Click
Text="单击窗体"
Label1.Text="欢迎使用VB.NET"
End Sub
窗体DoubleClick事件
Private Sub Form1_DoubleClick() Handles Me.DoubleClick
Text="双击窗体"
Label1.Text = "谢谢使用!"
End Sub
VB.net中如何在picturebox画线,有什么函数?Dim b As New Bitmap(PictureBox1.Width, PictureBox1.Height)
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怎么实现图像的处理这问题有点笼统vb.net图片描边,软糖来说说把vb.net图片描边:
图像处理由System.Drawing命名空间负责 。
主要是Bitmap类和Graphics类 。
Bitmap表示一个位图,可以是BMP,JPG,PNG等文件 。
装载位图
Dim 位图 As Bitmap = Bitmap.FromFile("C:\Image1.PNG")
Graphics表示一张画纸,能够进行绘制操作 。
它可以被窗体、控件、位图调用CreateGraphics()方法来创建 。
然后调用Graphics.Draw开头vb.net图片描边的一系列函数来绘制图像和图形,Fill开头的填充图形 。
创建画纸并绘制位图
Dim 画纸 As Graphics = Me.CreateGraphics()
画纸.DrawImage(位图, 100, 100, 256, 256)
可以将上面三行放到Form1_Load中测试,把路径改一下,
还可以把Me改为能在上面绘图的控件的名称 。
更多内容请看MSDN的System.Drawing命名空间 。
如满意,请采纳,谢谢 。
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如何对picturebox1的图片进行高斯模糊?Imports System
Imports System.Drawing
Imports System.Drawing.Imaging
Imports System.Runtime.InteropServices
''' summary
''' Summary description for TextShadow
''' /summary
''' remarks/remarks
Public Class gaoshiBLUR
Public newbmp As Bitmap
StructLayout(LayoutKind.Explicit) Structure rgbA
FieldOffset(0) Public R As Byte
FieldOffset(1) Public G As Byte

推荐阅读