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. how to create image manually

how to create image manually

Scheduled Pinned Locked Moved C#
graphicstutorialquestion
5 Posts 4 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
    Ronenb
    wrote on last edited by
    #1

    Hi I would like to draw an image that contains lines , text and rectangles. In order to draw it I need to use the graphics object. Also I would like window\control will handle scroll bar, drawing the image automatically in case the image move with the mouse for example, so I was thinking to use image object in order to store my image How can I export the image I created manually from graphic object (after I create all the items I want such as line, rectangle, etc on panel for example) to image object? Thanks Ronen

    B L B 3 Replies Last reply
    0
    • R Ronenb

      Hi I would like to draw an image that contains lines , text and rectangles. In order to draw it I need to use the graphics object. Also I would like window\control will handle scroll bar, drawing the image automatically in case the image move with the mouse for example, so I was thinking to use image object in order to store my image How can I export the image I created manually from graphic object (after I create all the items I want such as line, rectangle, etc on panel for example) to image object? Thanks Ronen

      B Offline
      B Offline
      benjymous
      wrote on last edited by
      #2

      You don't need to - just create a new Bitmap, the create a new graphics object, and draw to that e.g. something like

      Bitmap bmp = new Bitmap( 640, 480 );
      using( Graphics G = Graphics.FromImage(bmp) )
      {
      G.FillRectangle(...);
      }

      Help me! I'm turning into a grapefruit! Buzzwords!

      R 1 Reply Last reply
      0
      • R Ronenb

        Hi I would like to draw an image that contains lines , text and rectangles. In order to draw it I need to use the graphics object. Also I would like window\control will handle scroll bar, drawing the image automatically in case the image move with the mouse for example, so I was thinking to use image object in order to store my image How can I export the image I created manually from graphic object (after I create all the items I want such as line, rectangle, etc on panel for example) to image object? Thanks Ronen

        L Offline
        L Offline
        Luc Pattyn
        wrote on last edited by
        #3

        Hi, you can create a Bitmap, obtain the corresponding Graphics (through Graphics.FromImage), paint to your hearts content, then use Bitmap.Save BTW: there are several articles about Paint-like apps here on CP. :)

        Luc Pattyn [Forum Guidelines] [My Articles]


        Fixturized forever. :confused:


        1 Reply Last reply
        0
        • R Ronenb

          Hi I would like to draw an image that contains lines , text and rectangles. In order to draw it I need to use the graphics object. Also I would like window\control will handle scroll bar, drawing the image automatically in case the image move with the mouse for example, so I was thinking to use image object in order to store my image How can I export the image I created manually from graphic object (after I create all the items I want such as line, rectangle, etc on panel for example) to image object? Thanks Ronen

          B Offline
          B Offline
          Brij
          wrote on last edited by
          #4

          Check the URL [^]">

          Cheers!! Brij

          1 Reply Last reply
          0
          • B benjymous

            You don't need to - just create a new Bitmap, the create a new graphics object, and draw to that e.g. something like

            Bitmap bmp = new Bitmap( 640, 480 );
            using( Graphics G = Graphics.FromImage(bmp) )
            {
            G.FillRectangle(...);
            }

            Help me! I'm turning into a grapefruit! Buzzwords!

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

            OK Thank u all, Itry to draw to bitmap and it work great How can I display it in the form Should I create picturebox control and load the bitmap to it? I would like the form to create scroll bar automaticly if need (in case the form is smaller then the bitmap image) Ronen

            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