TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
praveen pvs
NA
1
5.2k
How to convert text to image in vb.net
Aug 16 2010 3:15 AM
Hello Every one
I need to convert text which is string to image in vb.net. I was doing in the following way
Dim OFile As System.IO.File
Dim OWrite As system.IO.TextWriter
OWrite = OFile.CreateText("Signature.tiff")
OWrite.Write(ControlData) 'ControlData is of type string
MessageBox.Show("Signature is recieved and it is saved in Signature.tiff")
signature.tiff is being created but when i opened the image nothing is seen.
Can you tell me what is wrong in this??
I even tried in the following way also
Dim BitMapObject As New Bitmap(400,400)
Dim GraphicsObject As Graphics = Graphics.FromImage(BitMapObject)
Dim objColor As Color
Dim objFont As New Font("Times New Roman", 12)
Dim objPoint As New PointF(5.0F, 5.0F)
Dim objBrushForeColor As New SolidBrush(Color.Blue)
Dim objBrushBackColor As New SolidBrush(Color.Black)
GraphicsObject.DrawString(ControlData,objFont, objBrushForeColor, objPoint)
BitMapObject.Save("Signature.tiff",Imaging.ImageFormat.Tiff)
In this case, signature.tiff is being created, when i clicked on the image to open, some junk message is being showed.
Please tell me if any problem is there.
I have read the article in this site at
http://www.dailycoding.com/Posts/convert_image_to_base64_string_and_base64_string_to_image.aspx
Will this work in my case? Do i need to import anything for the above code to be worked in my system.
Please help me out.
Thanks..
Reply
Answers (
2
)
Marshal.FreeHGlobal Failure
problem in calling dropdown ....through if-else