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#
  4. Save All text in richTextBox as image

Save All text in richTextBox as image

Scheduled Pinned Locked Moved C#
2 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.
  • M Offline
    M Offline
    mm310
    wrote on last edited by
    #1

    How I can Save All text in richTextBox as image

    E 1 Reply Last reply
    0
    • M mm310

      How I can Save All text in richTextBox as image

      E Offline
      E Offline
      Ed Poore
      wrote on last edited by
      #2

      If you take this [^]article as the basis (ok, it adds extra things as syntax highlighting but those can be removed).  All you need to do then is call DrawEditControl with a Graphics object created from an image rather than a PrintDocument.  E.g.

      private void Print()
      {
          using (Bitmap image = new Bitmap(width, height, PixelFormat.Format24bppRgb))
          {
             using (Graphics gfx = Graphics.FromImage(image))
              {
                   DrawEditControl(gfx);
              }
              image.Save(filename, ImageFormat.Bmp);
          }
      }


      As of how to accomplish this I wouldn't have a clue at the moment and I'm too lazy to google it

      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