Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How can i write text in a tif picture?

How can i write text in a tif picture?

Scheduled Pinned Locked Moved C / C++ / MFC
questionhelp
6 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    RonnyS
    wrote on last edited by
    #1

    Hello! I wanna write a Text in a tif picture. It can be intern in the tif File (if it's possible) or the text can also stay in a corner of the picture... Or if you know another (easyer) way to save a text into the tif picture, please tell me!! I have no idea how i could do this! Please Help me! Thanks! Greetings Ronny

    P 1 Reply Last reply
    0
    • R RonnyS

      Hello! I wanna write a Text in a tif picture. It can be intern in the tif File (if it's possible) or the text can also stay in a corner of the picture... Or if you know another (easyer) way to save a text into the tif picture, please tell me!! I have no idea how i could do this! Please Help me! Thanks! Greetings Ronny

      P Offline
      P Offline
      parths
      wrote on last edited by
      #2

      Have you read the TIFF Format[^] specs? If yes, then the easiest way I know about is: 01. Create your character matrices (these can be simple 2D byte arrays specifying the on/off status of a pixel) e.g 00011000 00100100 00100100 00111100 01000010 01000010 10000001 10000001 can be 'A' 02. now, create your image data using these. 03. Then create your tiff specification Tags. 04. Write all the data into a file. I Hope this helps "It was when I found out I could make mistakes that I knew I was on to something." -Ornette Coleman "Philosophy is a study that lets us be unhappy more intelligently." -Anon.

      R 1 Reply Last reply
      0
      • P parths

        Have you read the TIFF Format[^] specs? If yes, then the easiest way I know about is: 01. Create your character matrices (these can be simple 2D byte arrays specifying the on/off status of a pixel) e.g 00011000 00100100 00100100 00111100 01000010 01000010 10000001 10000001 can be 'A' 02. now, create your image data using these. 03. Then create your tiff specification Tags. 04. Write all the data into a file. I Hope this helps "It was when I found out I could make mistakes that I knew I was on to something." -Ornette Coleman "Philosophy is a study that lets us be unhappy more intelligently." -Anon.

        R Offline
        R Offline
        RonnyS
        wrote on last edited by
        #3

        Hello and thanks for your answer! But sorry that was a little bit to fast for me! I have a tif picture wich already exists, and i want to inser a text anyway..... Or can you tell me what functions i have to use? Thanks! Ronny

        P 1 Reply Last reply
        0
        • R RonnyS

          Hello and thanks for your answer! But sorry that was a little bit to fast for me! I have a tif picture wich already exists, and i want to inser a text anyway..... Or can you tell me what functions i have to use? Thanks! Ronny

          P Offline
          P Offline
          parths
          wrote on last edited by
          #4

          Ok, Try taking a look at the LibTiff[^] library. It is an opensource library for working with tiff images. You'll get usage intructions on the site too. What I was trying to say earlier was, that one way I found for writing text into image files is to create 2D pixel-value matrices for each character. i.e. each element in the matrix will be a pixel value. Then when you want to write a character in to an image, you just need to pick up the correct matrix and copy the pixel values in the correct positions. I'm not too sure even this explaination was good enough, well, I've never been too good at explaining things :)... just take a look at libtiff, it should help a bit. Also, searching google will give you a lot of great tuts. I hope this helps "It was when I found out I could make mistakes that I knew I was on to something." -Ornette Coleman "Philosophy is a study that lets us be unhappy more intelligently." -Anon.

          R 1 Reply Last reply
          0
          • P parths

            Ok, Try taking a look at the LibTiff[^] library. It is an opensource library for working with tiff images. You'll get usage intructions on the site too. What I was trying to say earlier was, that one way I found for writing text into image files is to create 2D pixel-value matrices for each character. i.e. each element in the matrix will be a pixel value. Then when you want to write a character in to an image, you just need to pick up the correct matrix and copy the pixel values in the correct positions. I'm not too sure even this explaination was good enough, well, I've never been too good at explaining things :)... just take a look at libtiff, it should help a bit. Also, searching google will give you a lot of great tuts. I hope this helps "It was when I found out I could make mistakes that I knew I was on to something." -Ornette Coleman "Philosophy is a study that lets us be unhappy more intelligently." -Anon.

            R Offline
            R Offline
            RonnyS
            wrote on last edited by
            #5

            Hello! That was a great Link! The Library supports really gut functions.... I have already tried many of these functions, but there is also a big problem. When i create a tif File with Photoshop i can open the file without any problems but if i open the File who i have in my application it don't works. Is it possible to load the tif file as bmp, so i can work with the bmp File and save it after as tif? If it is possible how can i load it, to write in the bmp i should use the GDI (or not?), and how can i convert after the bmp in a tif file? And it is very importand that the pic don't lose quality, is it possible with out losing quality? I thank you very much for your help! Ronny

            P 1 Reply Last reply
            0
            • R RonnyS

              Hello! That was a great Link! The Library supports really gut functions.... I have already tried many of these functions, but there is also a big problem. When i create a tif File with Photoshop i can open the file without any problems but if i open the File who i have in my application it don't works. Is it possible to load the tif file as bmp, so i can work with the bmp File and save it after as tif? If it is possible how can i load it, to write in the bmp i should use the GDI (or not?), and how can i convert after the bmp in a tif file? And it is very importand that the pic don't lose quality, is it possible with out losing quality? I thank you very much for your help! Ronny

              P Offline
              P Offline
              parths
              wrote on last edited by
              #6

              I think the libtiff library gives you the image data... which you can work with. I'm not sure. "It was when I found out I could make mistakes that I knew I was on to something." -Ornette Coleman "Philosophy is a study that lets us be unhappy more intelligently." -Anon.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups