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. GDI related

GDI related

Scheduled Pinned Locked Moved C / C++ / MFC
graphicsquestion
3 Posts 3 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.
  • I Offline
    I Offline
    Imran Farooqui
    wrote on last edited by
    #1

    Hi !! I want to convert text file into image file (jpg or tiff or gif) and save it. Can anyone tell me how ??? Thanks in advance.

    C P 2 Replies Last reply
    0
    • I Imran Farooqui

      Hi !! I want to convert text file into image file (jpg or tiff or gif) and save it. Can anyone tell me how ??? Thanks in advance.

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      You need to draw it yourself. Create a bitmap, and then draw the text on it. If you want to save in something other than bmp you need something like CXImage, GDI+ or Paintlib. I have lots of GDI+ articles on CP, and CXImage also lives here. Christian No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002 Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002 Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002

      1 Reply Last reply
      0
      • I Imran Farooqui

        Hi !! I want to convert text file into image file (jpg or tiff or gif) and save it. Can anyone tell me how ??? Thanks in advance.

        P Offline
        P Offline
        Paul M Watt
        wrote on last edited by
        #3

        You will need to load it into memory, then render it to a bitmap. You can do that by creating a bitmap and a memory device context then render the text with the DrawText API. After that you can save it out. There is no default mechanism to save JPG or GIF files in the Win32 API so you will need to use the LibJPEG or some other libraries in order to save your image. Good Luck


        Build a man a fire, and he will be warm for a day
        Light a man on fire, and he will be warm for the rest of his life!

        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