Results 1 to 30 of 30

Thread: Making Picture With VB

Threaded View

  1. #2
    PowerPoster Keithuk's Avatar
    Join Date
    Jan 2004
    Location
    Staffordshire, England
    Posts
    2,236
    Yes you can but it will save as a BMP.

    VB Code:
    1. Sub Form_Load()
    2.  
    3. Picture1.Picture = LoadPicture(App.Path & "\My Pic.jpg")
    4.  
    5. End Sub
    6.  
    7. Private Sub cmdAddText_Click()
    8.  
    9. Picture1.AutoRedraw = True
    10. Picture1.CurrentX = Picture1.Height / 2 'X Position you want to print text
    11. Picture1.CurrentY = Picture1.Width / 2 'Y Position you want to print text
    12. Picture1.FontSize = 16
    13. Picture1.ForeColor = vbRed
    14. Picture1.Print "This is a sample"
    15.  
    16. End Sub
    17.  
    18. Private Sub cmdSave_Click()
    19.  
    20. SavePicture Picture1.Image,  App.Path & "\Test.bmp"   ' Save picture to file.
    21.  
    22. End Sub
    Last edited by Keithuk; Dec 29th, 2004 at 05:45 PM.
    Keith

    I've been programming with VB for 25 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.

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