[RESOLVED] save picture as bitmap or jpeg
:wave: i am try to save a picturefile as a bitmap or a jpeg but cannot seem to figure out how to do this can any one help!!! i tryed this
VB Code:
Private Sub cmdSave_Click()
'Call for the common dialog control to show the save menue
Dim myPic As String
cdbFile.ShowSave
myPic = frmDraw.Image
Open myPic For Output As #1.bmp
Print #1, myPic
Close #1
End Sub
thanks in advance RedAngel
Re: save picture as bitmap or jpeg
VB can only save images as BITMAPs, for JPG type you'll need some thir party's ocx/dll:
VB Code:
Private Sub Command1_Click()
SavePicture Picture1.Picture, "C:\Temp\test.bmp"
End Sub
Re: save picture as bitmap or jpeg
thanks rhino bull but i also want the user to be able to browse to where to save the bitmap hence the use of the (cdbFile.ShowSave)
Re: save picture as bitmap or jpeg
got it working with this
Private Sub cmdSave_Click()
'Call for the common dialog control to show the save menue
cdbFile.ShowSave
SavePicture frmDraw.Image, "Save Picture1.bmp"
End Sub
Re: save picture as bitmap or jpeg
Here's what I would do:
VB Code:
Private Sub Command1_Click()
Dim strFile$
With CommonDialog1
.Flags = cdlOFNExplorer
.Filter = "Windows Bitmap (*.bmp;)|*.bmp;"
.ShowSave
strFile = .FileName
If Not strFile = "" Then
SavePicture Picture1.Picture, strFile
End If
End With
End Sub
Re: [RESOLVED] save picture as bitmap or jpeg
Set your CommonDialog.Filter to bmp or jpg then which ever Filter is selected use SavePicture or BmpToJpeg.dll.
http://www.vbforums.com/showthread.php?t=292119&
There's no need to register this dll just put it in your Windows\System folder.