www.pudn.com > AVPhone.zip > Form9.frm
VERSION 5.00
Begin VB.Form Form9
BorderStyle = 3 'Fixed Dialog
Caption = "Snapshot"
ClientHeight = 2340
ClientLeft = 1995
ClientTop = 5415
ClientWidth = 3150
LinkTopic = "Form9"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2340
ScaleWidth = 3150
ShowInTaskbar = 0 'False
StartUpPosition = 3 'Windows Default
Begin VB.PictureBox Picture1
AutoSize = -1 'True
BorderStyle = 0 'None
Height = 1812
Left = 0
ScaleHeight = 1815
ScaleWidth = 2640
TabIndex = 0
Top = 0
Width = 2640
End
Begin VB.Menu mnuSave
Caption = "&Save!"
End
Begin VB.Menu mnuOpen
Caption = "&Open!"
End
Begin VB.Menu mnuTake
Caption = "&Take!"
End
End
Attribute VB_Name = "Form9"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
On Error GoTo ErrorHandle
If KeyCode = 75 Then Form1.TakePicture
Exit Sub
ErrorHandle:
ShowErr
End Sub
Private Sub Form_Load()
Set Icon = Nothing
KeyPreview = True
End Sub
Private Sub mnuOpen_Click()
On Error GoTo ErrorHandle
SetPicture LoadPicture(GetOpenFile(hwnd, 2))
Exit Sub
ErrorHandle:
If Err <> 32755 Then ShowErr
End Sub
Private Sub mnuSave_Click()
On Error GoTo ErrorHandle
SavePicture Picture1, GetSaveASFile(hwnd, 2)
Exit Sub
ErrorHandle:
If Err <> 32755 Then ShowErr
End Sub
Friend Sub SetPicture(Pict As Object)
With Picture1
Set .Picture = Pict
Move Left, Top, Width - ScaleWidth + .Width, Height - ScaleHeight + .Height
End With
End Sub
Private Sub mnuTake_Click()
On Error GoTo ErrorHandle
Form1.TakePicture
Exit Sub
ErrorHandle:
ShowErr
End Sub