In my application the user can write from keyboard on an image. Is it possible to display the caret on the image (as in TextBox for example)?
In my application the user can write from keyboard on an image. Is it
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You’ve got 3 separate issues:
1) Drawing Text at arbitrary locations.
See MSDN DrawString Method
2) Merging two separate images (the original and the text) into one.
As far as I know the image host controls, that you’re likely using to show the image, provide a bitmap object property, so you need to be able to save that bitmap object to a file once you’ve done the DrawString.
3) Draw the caret symbol at arbitrary locations
You can do this with basic drawing commands to create your own caret, that’s using Graphics with Pens and Paths.
Then the issue is to make it flash (which means drawing what’s underneath your caret again, then your caret etc)
I think there’s options on the Pen object that might achieve this for you.
I would tackle each in turn then put them together.