Dynamically updating image (PNG)
-
Hello there, I am working on a Windows application using Visual Studio 2012. One of the screens have a text entry field for the user. Instead of using a standard text field control, am placing a image which looks exactly like a text field. Now what i want to do is, capture the key stroke and update this image with the characters entered by user. The initial image shown to the user is "Blank_Text_Entry.png" and this is added to the resource as IDB_BLANK_TEXT_ENTRY. This is a rectangular white image with dimensions 153 x 27, with a size of 250 bytes. My goal is to be able to update this image dynamically based on key strokes by user and display it. Is it possible to do something like this? If yes, can anyone share some sample code? Thanks in advance.
-
Hello there, I am working on a Windows application using Visual Studio 2012. One of the screens have a text entry field for the user. Instead of using a standard text field control, am placing a image which looks exactly like a text field. Now what i want to do is, capture the key stroke and update this image with the characters entered by user. The initial image shown to the user is "Blank_Text_Entry.png" and this is added to the resource as IDB_BLANK_TEXT_ENTRY. This is a rectangular white image with dimensions 153 x 27, with a size of 250 bytes. My goal is to be able to update this image dynamically based on key strokes by user and display it. Is it possible to do something like this? If yes, can anyone share some sample code? Thanks in advance.
You can sure do that... but it seems WAY more painful than taking a text control and adapting it to do whatever it is you want. If I may ask, why is it that you want to draw it yourself rather than changing an existing field control? BTW, the way you would do it is by custom drawing using something like GDI. Easiest way would be to draw the blank entry box first, then update it with textual line items... problem is making it look and act nice would be a pain.