|
-
Jan 14th, 2012, 02:58 PM
#1
Thread Starter
New Member
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 ..
-
Jan 15th, 2012, 10:50 AM
#2
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
-
Jan 15th, 2012, 04:55 PM
#3
Thread Starter
New Member
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 ..
-
Jan 16th, 2012, 01:24 PM
#4
Thread Starter
New Member
-
Jan 17th, 2012, 05:06 PM
#5
Thread Starter
New Member
-
Jan 20th, 2012, 08:25 AM
#6
Thread Starter
New Member
-
Jan 20th, 2012, 08:47 AM
#7
Hyperactive Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|