1
我在我的SQL Server中有一個PNG圖片,我成功獲取圖像並將其保存到文件。將保存爲BMP/JPG的SQL Server的PNG圖片
rs.Open "Select pic from Table", connObj, adOpenDynamic, adLockOptimistic
If rs.RecordCount > 0 Then
If Not IsNull(rs.Fields("pic").Value) Then
Set mstream = New ADODB.Stream
mstream.Type = adTypeBinary
mstream.Open
mstream.Write rs.Fields("pic").Value
mstream.SaveToFile App.Path & "\MyPhoto.jpg", adSaveCreateOverWrite
End If
End If
rs.Close
正如你可以看到我已經有我的分機爲JPG格式,但我不認爲它很重要,當我使用LoadPicture()
我得到一個錯誤Invalid Picture
使用圖像在我的VB6應用程序。如果我打開圖像並將其保存爲JPG或BMP,LoadPicture()
的作品。
那麼,如何正確保存圖片爲bmp/jpg?
你問如何從PNG格式轉換爲JPG格式? – DaveInCaz