|
-
Aug 7th, 2001, 11:21 AM
#1
Thread Starter
Fanatic Member
Saving Pictures
How would I go about saving a picture that I drew at runtime?
-
Aug 15th, 2001, 12:12 AM
#2
Fanatic Member
Thats an easy one.
To a form add...
1. PictureBox (named: Picture1) with Auto Redraw set to 2. Button (named: cmdSave)
and paste the following code
PHP Code:
'Code by Shahid Thaika
Private Sub cmdSave_Click()
'Save the picture
SavePicture Picture1.Image, "C:\Picutre.bmp"
MsgBox "Saved Picture to 'C:\Picture.bmp'", vbOKOnly + vbInformation, "Saved"
End Sub
'Put whatever code you want for drawing
'But draw it to Picture Box
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
'Start at wherever we clicked first
Picture1.CurrentX = X
Picture1.CurrentY = Y
End Sub
Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
'Draw lines if only the Ctrl Key is pressed
If Shift = 2 Then Picture1.Line -(X, Y)
End Sub
THE TIME/WEATHER IS 
Don't know how to use APIs or have problem with them,
Download API-Guide & API-Viewer from http://www.allapi.net
-
Aug 15th, 2001, 12:15 AM
#3
Fanatic Member
OOPS
Oops used PHP instead of Code. This will look better
To a form add...
1. PictureBox (named: Picture1) with Auto Redraw set to True
2. Button (named: cmdSave)
and paste the following code
Code:
'Code by Shahid Thaika
Private Sub cmdSave_Click()
'Save the picture
SavePicture Picture1.Image, "C:\Picutre.bmp"
MsgBox "Saved Picture to 'C:\Picture.bmp'", vbOKOnly + vbInformation, "Saved"
End Sub
'Put whatever code you want for drawing
'But draw it to Picture Box
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
'Start at wherever we clicked first
Picture1.CurrentX = X
Picture1.CurrentY = Y
End Sub
Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
'Draw lines if only the Ctrl Key is pressed
If Shift = 2 Then Picture1.Line -(X, Y)
End Sub
THE TIME/WEATHER IS 
Don't know how to use APIs or have problem with them,
Download API-Guide & API-Viewer from http://www.allapi.net
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|