Results 1 to 3 of 3

Thread: Saving Pictures

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2000
    Location
    Oregon
    Posts
    962

    Saving Pictures

    How would I go about saving a picture that I drew at runtime?

  2. #2
    Fanatic Member 007shahid's Avatar
    Join Date
    Feb 2001
    Posts
    562
    Thats an easy one.
    To a form add...
    1. PictureBox (named: Picture1) with Auto Redraw set to
    PHP Code:
    True 
    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 IntegerShift As IntegerAs SingleAs 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 -(XY)
    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

  3. #3
    Fanatic Member 007shahid's Avatar
    Join Date
    Feb 2001
    Posts
    562

    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
  •  



Click Here to Expand Forum to Full Width