從文件中獲取圖像大小 Dim fi As FileInfo Dim imageLen as Integer fi = New FileInfo(lblFilePath.Text) imageLen = (fi.Length / 1024).ToString("0.0") + "KB"從picturebox中獲取圖像大小 Dim ms As New MemoryStream Dim arrImage() As Byte pictureboxname.Image.Save(ms,pictureboxname.Image.RawFormat) arrImage = ms.GetBuffer ms.Close() imageLen = (arrImage.Length / 1024).ToString("0.0") + "KB"
Dim fi As FileInfo
Dim imageLen as Integer
fi = New FileInfo(lblFilePath.Text)
imageLen = (fi.Length / 1024).ToString("0.0") + "KB"從picturebox中獲取圖像大小
Dim ms As New MemoryStream
Dim arrImage() As Byte
pictureboxname.Image.Save(ms,pictureboxname.Image.RawFormat)
arrImage = ms.GetBuffer
ms.Close()
imageLen = (arrImage.Length / 1024).ToString("0.0") + "KB"