July 30th, 2015, 11:49 AM
Add text to image in picturebox
I'm still pretty new to programming so please bare with me and any help that can be offered is greatly appreciated. I have a program in which the user loads an image which is displayed in a picturebox. The user can then print this image from their printer. I would like to add controls which will allow the user to click anywhere in the picture box and then type text which will be printed on the image when the image is later printed. I would like the user to be able to select the font from a list of fonts already installed on the users PC as well as the size of the font and the color. Once the text is typed, id like the user to have the ability to click the text and be able to move it, edit it or delete it.
Is this something that would be fairly simple to do? Any one know of a tutorial or guide that will walk me through the process of doing something like this? Thanks in advance for any help!
August 13th, 2015, 10:31 AM
Re: Add text to image in picturebox
If I'm not mistaken, you'll want to use "annotations" in your project. Otherwise, you’ll have to write the text into the image data, and this will make it difficult to manage removing/modifying any text that was previously written. This Wikipedia article gives a little explanation: https://en.wikipedia.org/wiki/Annotation#Imaging
I found this article about adding annotations to an image, but it doesn't mention how to print it with the image:
You can also use the "Leadtools" SDK, which allows you to control the text formatting in annotations:
Click Here to Expand Forum to Full Width
This a Codeguru.com survey!