vbnet保留绘图 vb中savepicture

关于vb.net中绘图并保存图片的问题ImportsSystem.Drawing.Imaging
PublicClassForm1
DimimageNameAsString="C:\DocumentsandSettings\...\1126.jpg "
DimiAsImage=Image.FromFile(imageName)
DimgAsGraphics=Graphics.FromImage(i)'此处从背景图创建Greaphics
PrivateSubButton1_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton1.Click
'划线
DimBluePenAsNewPen(Color.Blue,5)
BluePen.DashStyle=Drawing2D.DashStyle.Solid
g.DrawLine(BluePen,100.0F,170,500.0F,170)
g.Dispose()
PictureBox1.Image=i
EndSub
PrivateSubButton2_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton2.Click
'退出
Me.Close()
EndSub
PrivateSubButton3_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton3.Click
'存盘
i.Save( "C:\testimage.jpg ",ImageFormat.Jpeg)
i.Dispose()
EndSub
PrivateSubForm1_Load(ByValsenderAsObject,ByValeAsSystem.EventArgs)HandlesMe.Load
PictureBox1.Image=i
EndSub
EndClass
vb.net GDI绘图刷新问题绘图代码写在Paint事件中,如
Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
Dim g As Graphics = Me.CreateGraphics
g.DrawLine(Pens.Red, 100, 100, 200, 100)
End Sub
'方法二:在 PictureBox1上显示图像----图画在Bitmap
PictureBox1.Image = Nothing
Dim wid As Integer = PictureBox1.ClientSize.Width
Dim hgt As Integer = PictureBox1.ClientSize.Height
Dim bm As New Bitmap(wid, hgt)
Dim g As Graphics = Graphics.FromImage(bm)
'画图代码
'画图代码
PictureBox1.Image = bm
PictureBox1.Refresh()
g.Dispose()
VB.net 怎样保存picturebox中的图像(vs2008)'因为要保存picturebox中的图片必须要设置autoredraw属性为true,所以也写出来了.
Private Sub Form_Load()
Picture1.AutoRedraw = True
End Sub
Private Sub Command1_Click()
SavePicture Picture1.Image, App.Path"\1.bmp"
End Sub
【vbnet保留绘图 vb中savepicture】vbnet保留绘图的介绍就聊到这里吧,感谢你花时间阅读本站内容,更多关于vb中savepicture、vbnet保留绘图的信息别忘了在本站进行查找喔 。

    推荐阅读