By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,562 Members | 1,298 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,562 IT Pros & Developers. It's quick & easy.

How to save image with the textbox(read-only) on it?

P: n/a
Hello,
I want to save a picture using that code and i have a read-only
textbox on the picturebox1 named "textbox2".

I want users to enter their custom text using "textbox1" and save the
image with the text associated to textbox2.text (will be saved/
displayed on picturebox1)

But when i save the picturebox1 is saved empty textbox.
How can i do that?
Public Class Form1
Dim myimage As Bitmap = picturebox1.Image
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Generate.Click
TextBox2.Text = TextBox1.Text

End Sub

Private Sub Save_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Save.Click

If savedialog.ShowDialog = Windows.Forms.DialogResult.OK Then
myimage.Save(savedialog.FileName)
End If
End Sub
End Class

Thanks.

Oct 26 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
I really have a hard time understanding what you are trying to describe. But
looking at your code, I believe you might be needing this for your
Button1_Click

picturebox1.image = new bitmap(cstr(textbox1.text))
' textbox1 may be ... "someImage.jpg"
"kimiraikkonen" wrote:
Hello,
I want to save a picture using that code and i have a read-only
textbox on the picturebox1 named "textbox2".

I want users to enter their custom text using "textbox1" and save the
image with the text associated to textbox2.text (will be saved/
displayed on picturebox1)

But when i save the picturebox1 is saved empty textbox.
How can i do that?
Public Class Form1
Dim myimage As Bitmap = picturebox1.Image
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Generate.Click
TextBox2.Text = TextBox1.Text

End Sub

Private Sub Save_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Save.Click

If savedialog.ShowDialog = Windows.Forms.DialogResult.OK Then
myimage.Save(savedialog.FileName)
End If
End Sub
End Class

Thanks.

Oct 30 '07 #2

P: n/a
On Oct 30, 5:09 am, chad <c...@discussions.microsoft.comwrote:
I really have a hard time understanding what you are trying to describe. But
looking at your code, I believe you might be needing this for your
Button1_Click
Hi,
I tried to decribe as much as clear but the project is a bit
extraordinary. Thanks but, the code you've given wasn't my need.

Think i have a custom jpg picture in a picture box(other methods are
welcome), and there's a textbox on it, the user enters sth using
"generate.click" button, then the text sits onto picture, the problem
is when i save the new picture (with the text on it), it only saves
base picture. But i want to save picture with the text TOGETHER which
was added by user (textbox2.text)

Thanks.

kimiraikkonen

Oct 30 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.