Imports System.Drawing.Imaging
成都创新互联提供高防物理服务器租用、云服务器、香港服务器、西部信息服务器托管等
Public Class Form1
Dim imageName As String = "C:\Documents and Settings\...\1126.jpg "
Dim i As Image = Image.FromFile(imageName)
Dim g As Graphics = Graphics.FromImage(i) '此处从背景图创建Greaphics
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'划线
Dim BluePen As New Pen(Color.Blue, 5)
BluePen.DashStyle = Drawing2D.DashStyle.Solid
g.DrawLine(BluePen, 100.0F, 170, 500.0F, 170)
g.Dispose()
PictureBox1.Image = i
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
'退出
Me.Close()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
'存盘
i.Save( "C:\testimage.jpg ", ImageFormat.Jpeg)
i.Dispose()
End Sub
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
PictureBox1.Image = i
End Sub
End Class
保存前加一句 myImage2.SetResolution(300, 300) 你设置的bMape不是保存的主画布 所以无效,设置分辨率就是 SetResolution(X,Y)
先用一个临时文件名保存,关闭原来的文件,删除它,然后把那个临时文件改名。Windows很多软件都是这么做的。
有什么问题吗?
你哪里不会呀?
这问题简单的要命,你看看MSDN 或者编程的时候找找属性方法,根据提示都可以做出来吧,感觉你真的不像是学VB.NET的
售后响应及时
7×24小时客服热线数据备份
更安全、更高效、更稳定价格公道精准
项目经理精准报价不弄虚作假合作无风险
重合同讲信誉,无效全额退款