Results 1 to 7 of 7

Thread: Save text to Picture

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2012
    Posts
    5

    Save text to Picture

    Hello and a good week ..

    I need code to build something that if I record the image in textbox1, etc. I keep one whole picture ..

    This style ..


  2. #2
    PowerPoster boops boops's Avatar
    Join Date
    Nov 2008
    Location
    Holland/France
    Posts
    3,201

    Re: Save text to Picture

    Hi reovens, welcome to VBForums. You can take a snapshot of most controls by the DrawToBitmap method. Suppose the dark grey area is a panel called Panel1. You could get the image like this:

    Code:
    Dim bmp As New Bitmap(Panel1.ClientSize.Width, Panel1.ClientSize.Height)
    Panel1.DrawToBitmap(bmp, New Rectangle(Point.Empty, bmp.Size)
    Then bmp will contain a snapshot of the panel and all its child controls, and you can do what you like with it: save it as a file, display it in another control etc.

    However there is a difference from the example you posted. The white background of the text boxes will also appear in the resulting bitmap. If that matters, you could instead draw all the texts in the right positions using Graphics.DrawString. But a simpler way would be to change the background color of all the text boxes to match the background of the panel just before you take the snapshot with DrawToBitmap; then change it back again afterwards.

    BB

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2012
    Posts
    5

    Re: Save text to Picture

    Thank you for your help ..

    But not all it could do ..

    You can bring me a little work on it I see how it works?

    Thank you, good evening ..

  4. #4

    Thread Starter
    New Member
    Join Date
    Jan 2012
    Posts
    5

    Re: Save text to Picture

    ????

  5. #5

    Thread Starter
    New Member
    Join Date
    Jan 2012
    Posts
    5

    Re: Save text to Picture

    help??

  6. #6

    Thread Starter
    New Member
    Join Date
    Jan 2012
    Posts
    5

    Re: Save text to Picture

    ????

  7. #7
    Hyperactive Member
    Join Date
    Jul 2011
    Posts
    278

    Re: Save text to Picture

    boops boops has provided you with a solution.

    If you have attempted to make use of this solution and it didn't work, was an error thrown up? Did it not have the desired effect? etc.

    I realise English isn't perhaps your first language, but explaining as much as you can will help others to help you.

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