H
hfb9531
Unregistered / Unconfirmed
GUEST, unregistred user!
Private Sub DownloadButton_Click()
Dim nret As Long
Dim cnt1 As Long
Dim picsize As Long
Dim FileName
Dim FileNum
On Error GoTo SampleError
If CamFolderList.ListIndex = -1 Then
MsgBox "No picture selected"
Exit Sub
End If
'Set current picture
ZoomScrl.Rye1.propCurrentPicture(nCurrentCamera) = CamFolderList.ListIndex + 1
'Get current picture file size
picsize = ZoomScrl.Rye1.propPicSize(nCurrentCamera)
ReDim Picbuff(picsize) As Byte
'Get current picture file name
FileName = ZoomScrl.Rye1.propFileName(nCurrentCamera)
ProgressForm.Caption = FileName
PictureForm.Caption = FileName
ProgressForm.Show 0, Me
'Get picture from camera
ZoomScrl.Rye1.GetPicture nCurrentCamera, picsize, Picbuff
SampleError:
If Err.Number <> 0 Then
MsgBox Err.Number
Else
PictureForm.Caption = FileName
ProgressForm.Message = "Saving..."
'Get file access ID
FileNum = FreeFile
'Create file
Open "Picture.jpg"
For Random As FileNum Len = 1
'Write index picture data
For cnt1 = 1 To picsize
Put FileNum, cnt1, Picbuff(cnt1 - 1)
Next
'Close index file
Close FileNum
Unload ProgressForm
Set PictureForm.PicCtrl.Picture = LoadPicture("Picture.jpg"
PictureForm.Show 0, Me
End If
End Sub
Dim nret As Long
Dim cnt1 As Long
Dim picsize As Long
Dim FileName
Dim FileNum
On Error GoTo SampleError
If CamFolderList.ListIndex = -1 Then
MsgBox "No picture selected"
Exit Sub
End If
'Set current picture
ZoomScrl.Rye1.propCurrentPicture(nCurrentCamera) = CamFolderList.ListIndex + 1
'Get current picture file size
picsize = ZoomScrl.Rye1.propPicSize(nCurrentCamera)
ReDim Picbuff(picsize) As Byte
'Get current picture file name
FileName = ZoomScrl.Rye1.propFileName(nCurrentCamera)
ProgressForm.Caption = FileName
PictureForm.Caption = FileName
ProgressForm.Show 0, Me
'Get picture from camera
ZoomScrl.Rye1.GetPicture nCurrentCamera, picsize, Picbuff
SampleError:
If Err.Number <> 0 Then
MsgBox Err.Number
Else
PictureForm.Caption = FileName
ProgressForm.Message = "Saving..."
'Get file access ID
FileNum = FreeFile
'Create file
Open "Picture.jpg"
For Random As FileNum Len = 1
'Write index picture data
For cnt1 = 1 To picsize
Put FileNum, cnt1, Picbuff(cnt1 - 1)
Next
'Close index file
Close FileNum
Unload ProgressForm
Set PictureForm.PicCtrl.Picture = LoadPicture("Picture.jpg"
PictureForm.Show 0, Me
End If
End Sub