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
questiongraphicstutorial
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.
  • J Offline
    J Offline
    John theKing
    wrote on last edited by
    #1

    I have a text/rich text box on a dialog. Vertical scroll is enabled for this text box. I write text on the text box. Ofcourse some text may be hidden that we can see after scrolling up or down. Now i want everything written in the text box to be represented by a CBitmap object. How can i do so ???? Actually i want the contents of text box to be stored in a bmp file. I know how to store CBitmap contents in a BMP file, but i don't know how to first represent the text box contents in CBitmap object (as it is). Thanks

    C 1 Reply Last reply
    0
    • J John theKing

      I have a text/rich text box on a dialog. Vertical scroll is enabled for this text box. I write text on the text box. Ofcourse some text may be hidden that we can see after scrolling up or down. Now i want everything written in the text box to be represented by a CBitmap object. How can i do so ???? Actually i want the contents of text box to be stored in a bmp file. I know how to store CBitmap contents in a BMP file, but i don't know how to first represent the text box contents in CBitmap object (as it is). Thanks

      C Offline
      C Offline
      Chris Losinger
      wrote on last edited by
      #2

      you can redirect a RichText control's output using the DrawBand and FormatRange calls. i don't have any code handy to share, but it really only takes a few lines to do this. try googling on those function calls. -c

      Chris Losinger
      Smaller Animals Software

      B 1 Reply Last reply
      0
      • C Chris Losinger

        you can redirect a RichText control's output using the DrawBand and FormatRange calls. i don't have any code handy to share, but it really only takes a few lines to do this. try googling on those function calls. -c

        Chris Losinger
        Smaller Animals Software

        B Offline
        B Offline
        basementman
        wrote on last edited by
        #3

        You can also create a memory DC, send the control a WM_PAINT message with the handle of that DC, and extract the BMP from the DC.

        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