Click here to Skip to main content
15,896,063 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Hi,
I have a problem in C#.
I want to give a data of text box & show it in the picture box content of text box and after that save the pixel in hex to the other text box.
For example, if you type :a
program give it and show in a picture box and then save pixels of picture box in hex.
Thank for your help & excuse for my poor english.
Posted
Updated 17-Mar-10 4:24am
v3

You want to draw your string on to a bitmap using the DrawString method of the Graphics object. Then you can use the Save method of the Bitmap class to save the image. I don't know what you mean by 'save in hex', but you will have a bitmap, not an image, and you can save it as bmp, jpg, png, etc.
 
Share this answer
 
What you want is so trivial, that you don't need a sample program, you just need to read the MSDN help on the Graphics object and the Bitmap object.
 
Share this answer
 
An example of drawing a string onto a bitmap.

http://www.switchonthecode.com/tutorials/csharp-snippet-tutorial-how-to-draw-text-on-an-image[^]

Except you would be using your

TextBox myTextBox = new TextBox();
g.DrawString(myTextBox.Text, new Font("Tahoma", 40), Brushes.White, new PointF(0, 0));
 
Share this answer
 
Please edit your post, don't hit the 'answer' button if you're not posting an answer.

You want to show the binary data of the bitmap ? Why ? What do you expect it to look like ?
 
Share this answer
 
thanks for your answer and guide
but can you write a simple code or give me a link of similar program or article?
this is a simple programs link
http://rapidshare.com/files/364560283/T2B4HW.rar.html
and hex = hexa decimal format
thanks again:rose:
 
Share this answer
 
thanks again for your effective & good help
im to go & search msdn in my pc
good luck :-D
 
Share this answer
 
Hi again
i search in a msdn & any & articles & links of its
and at now (mid night ) im really mixed up & really hanged
please if can you write for me a code of that or link me a similar project that i can find some new information about it
i put a lnk of screen of a similar program here

http://www.upic.ir/share-BA3D_4BA1499D.html

as you see
1-user write text in a text box
2-programm save data in a string
3-convert & display it in image
4-show hex data of pixels in a second text box
thanks a lot
 
Share this answer
 
v3
as you see in image user can give a hexadecimal code of the picture
ex cuse me but thats not a binary its hexadecimal
binary = 0 or 1
decimal = 0,1,2,3,4,5,6,7,8,9
hexadecimal = 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E
and i need that for display string in a dot matrix LED board
............
and thanks Tim
im to go and test your codes
.............
& as you see in image i think a strings dont write in a picture box ( or thats control are not picture box )
that devide to a some section and if a part of string be in each section that will be on
...........
and how i can give and convert data of that picture to the text box?
i think must use get pixel or similar but i dont know exactly what to do?

thanks again:thumbsup:
 
Share this answer
 
any one else has no idea?
if you can please help me?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900