-
December 26th, 2013, 06:53 PM
#1
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.
-
December 27th, 2013, 12:53 AM
#2
Re: Dynamically updating image (PNG)
What's the underlying goal? I mean, you seem to be going out of your way not to use the control designed for text input.
-
December 27th, 2013, 02:52 AM
#3
Re: Dynamically updating image (PNG)
Basically "capture the key stroke" can be done by handling keyboard messages WM_KEYDOWN, WM_KEYUP or WM_CHAR.
"Update the image dynamically" can be done by handling WM_PAINT message. In the WM_PAINT message handler can use device context(s) to draw/compose images, texts and so on.
-
December 27th, 2013, 04:10 AM
#4
Re: Dynamically updating image (PNG)
Originally Posted by Don Guy
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.
What you do here looks like implementing just a custom edit box. I'm pretty sure there might be some other and much easier ways to achieve the same result.
I can imagine only one reason for placing image instead of text: a protection from grabbing text. So, is it your ultimate goal?
Best regards,
Igor
-
December 27th, 2013, 10:23 AM
#5
Re: Dynamically updating image (PNG)
The ultimate goal is protection itself.
-
December 28th, 2013, 06:21 AM
#6
Re: Dynamically updating image (PNG)
Originally Posted by Don Guy
The ultimate goal is protection itself.
Protection against what? Copy and paste, human recognition, OCR, something else?
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
|