Results 1 to 2 of 2

Thread: Turning Text into a Graphic?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Dec 2002
    Posts
    196

    Question Turning Text into a Graphic?

    Is it possible to turn text into an image? What I want to do is overlay a picture on top of a DirectX game. Basically I want my own menu overlayed on top of a DirectX game. The easiest way to do this would be to turn a block of text into a graphic then just overlay that one graphic. For starters I read something in one of my books about using the Print method for displaying text in a picture box; but I don't see the Print method as one of the methods of a picture box. If I can do that, can I save what's in the picture box as a graphics file?
    Brandon S Davids

  2. #2
    Frenzied Member KayJay's Avatar
    Join Date
    Jul 2001
    Location
    Chennai
    Posts
    1,849
    Yes and Yes.
    VB Code:
    1. Private Sub Command1_Click()
    2. Picture1.ScaleMode = vbPixels
    3. Picture1.Height = 150
    4. Picture1.Width = 250
    5. Picture1.AutoRedraw = True
    6.  
    7.  
    8. Picture1.Print "Hello and Hi"
    9. Picture1.Print
    10. Picture1.Print "Print this paragraph onto a PicBox and save"
    11. Picture1.Print "it as a Bitmap image. This way, the text in this"
    12. Picture1.Print "paragraph is not available for editing, except maybe"
    13. Picture1.Print "with some sort of OCR"
    14. Picture1.Print
    15. Picture1.Print "Such images can could also be used for overlaying"
    16. Picture1.Print "whatever that may be!"
    17.  
    18. Call SavePicture(Picture1.Image, App.Path & "\test.bmp")
    19. Shell "mspaint.exe" & Chr$(32) & App.Path & "\test.bmp", vbMaximizedFocus
    20. End Sub
    HTH

    "Brothers, you asked for it."
    ...Francisco Domingo Carlos Andres Sebastian D'Anconia

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