VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



A Picture Viewer with Zoom/NoZoom and Rotation Techniques

by M. Adeel Ahmad [TNC] (1 Submission)
Category: Graphics
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Thu 7th March 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)

A Picture Viewer with Zoom/NoZoom and Rotation Techniques

Rate A Picture Viewer with Zoom/NoZoom and Rotation Techniques



'5 Command Buttons, 1 Text Box and on PictureControl
'
'
'
'
'

'
Dim zoom As Integer

Private Sub Command1_Click()
Picture1.PaintPicture Picture1.Picture, Picture1.ScaleWidth, Picture1.ScaleHeight, -1 * Picture1.ScaleWidth, -1 * Picture1.ScaleHeight
End Sub

Private Sub Command2_Click()
zoom = zoom + Val(Text1.Text)
Picture1.PaintPicture Picture1.Picture, 0, 0, Picture1.ScaleWidth + zoom, Picture1.ScaleHeight + zoom

End Sub

Private Sub Command3_Click()
zoom = zoom - Val(Text1.Text)
Picture1.PaintPicture Picture1.Picture, 0, 0, Picture1.ScaleWidth + zoom, Picture1.ScaleHeight + zoom

End Sub

Private Sub Command4_Click()
Picture1.AutoSize = True
zoom = 0
End Sub


Private Sub Command5_Click()
Picture1.PaintPicture Picture1.Picture, Picture1.ScaleWidth, 0, -1 * Picture1.ScaleWidth, Picture1.ScaleHeight
End Sub

Private Sub Command6_Click()
End Sub

Private Sub Dir1_Change()
File1.Path = Dir1.Path
End Sub

Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
End Sub

Private Sub File1_Click()
Picture1.Picture = LoadPicture(Dir1.Path + "\" + File1.FileName)
End Sub

Private Sub Form_Load()
Picture1.AutoSize = True
Text1.Text = 1
zoom = 0



End Sub

Private Sub Picture1_Click()

End Sub

Private Sub Text1_Change()
If Val(Text1.Text) = 0 Then
    MsgBox "Invalid Number"
    Text1.Text = 0
    zoom = 0

End If
End Sub


Download this snippet    Add to My Saved Code

A Picture Viewer with Zoom/NoZoom and Rotation Techniques Comments

No comments have been posted about A Picture Viewer with Zoom/NoZoom and Rotation Techniques. Why not be the first to post a comment about A Picture Viewer with Zoom/NoZoom and Rotation Techniques.

Post your comment

Subject:
Message:
0/1000 characters