将PictureBox控件里的图片,保存为文件:
创新互联公司-专业网站定制、快速模板网站建设、高性价比镇宁网站开发、企业建站全套包干低至880元,成熟完善的模板库,直接使用。一站式镇宁网站制作公司更省心,省钱,快速模板网站建设找我们,业务覆盖镇宁地区。费用合理售后完善,十多年实体公司更值得信赖。
1,文件格式不变化:
PictureBox1.Image.Save("C:\" Format(Now, "HH-mm-ss") ".bmp")
2,文件格式有变化:
PictureBox1.Image.Save("C:\" Format(Now, "HH-mm-ss") ".bmp", System.Drawing.Imaging.ImageFormat.Bmp)
刚写了个测试通过
Public Class Form4
Dim d As String
Dim wkd As String
Dim wd As String
Dim hms As String
Dim y As String
Dim mouth As String
Dim dd As String
Dim allymd As String
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
hms = Now.ToString("HH:mm:ss")
wkd = DateTime.Today.DayOfWeek.ToString
y = Now.ToString("yyyy") + "年"
mouth = Now.ToString("MM") + "月"
dd = Now.ToString("dd") + "日"
allymd = y + mouth + dd
Select Case wkd
Case "Sunday"
wd = "星期天"
Case "Monday"
wd = "星期一"
Case "Tuesday"
wd = "星期二"
Case "Wednesday"
wd = "星期三"
Case "Thursday"
wd = "星期四"
Case "Friday"
wd = "星期五"
Case "Saturday"
wd = "星期六"
End Select
Label1.Text = allymd + " " + wd + " " + hms + " "
End Sub
End Class
图片框的名称叫display吗?
Public Sub DrawStr(ByVal pis As PictureBox, ByVal n As String)
Dim b As New Bitmap(pis.Width, pis.Height)
Dim g As Graphics = Graphics.FromImage(b)
g.Clear(Color.White)
Dim p As New Pen(Color.Black)
Dim bs As New SolidBrush(Color.Green)
Dim po As New Point
Dim fo As New Font("宋体", 2 * pis.Height / 3, FontStyle.Bold, GraphicsUnit.Pixel)
po.X = 0
po.Y = 0
g.DrawString(n, fo, bs, po.X, po.Y)
pis.Image = b
End Sub