CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2015

    Question 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!


  2. #2
    Join Date
    Aug 2015

    Re: Add text to image in picturebox

    Hello Bayat.

    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:

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.