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. saving image from screen

saving image from screen

Scheduled Pinned Locked Moved C#
graphicsquestion
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.
  • H Offline
    H Offline
    HexaDeveloper
    wrote on last edited by
    #1

    hi all how can i use the graphics object of the form to store its contents as an image thanks Generator

    G 1 Reply Last reply
    0
    • H HexaDeveloper

      hi all how can i use the graphics object of the form to store its contents as an image thanks Generator

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      You can't. Use the DrawToBitmap method of the form, or create an Image and use the Graphics.CopyFromScreen method on a Graphics object for the image.

      --- single minded; short sighted; long gone;

      H 1 Reply Last reply
      0
      • G Guffa

        You can't. Use the DrawToBitmap method of the form, or create an Image and use the Graphics.CopyFromScreen method on a Graphics object for the image.

        --- single minded; short sighted; long gone;

        H Offline
        H Offline
        HexaDeveloper
        wrote on last edited by
        #3

        ok what about if i want to draw in empty image by my self dawing some images and some shapes thanx Generator

        G 1 Reply Last reply
        0
        • H HexaDeveloper

          ok what about if i want to draw in empty image by my self dawing some images and some shapes thanx Generator

          G Offline
          G Offline
          Guffa
          wrote on last edited by
          #4

          Create a Bitmap object and a Graphics object from it, then draw using the Graphics object.

          --- single minded; short sighted; long gone;

          H 1 Reply Last reply
          0
          • G Guffa

            Create a Bitmap object and a Graphics object from it, then draw using the Graphics object.

            --- single minded; short sighted; long gone;

            H Offline
            H Offline
            HexaDeveloper
            wrote on last edited by
            #5

            sorry, but can i have some explanation i want to draw some objects in image then save this image in disk the save is not a problem thanx Generator

            H 1 Reply Last reply
            0
            • H HexaDeveloper

              sorry, but can i have some explanation i want to draw some objects in image then save this image in disk the save is not a problem thanx Generator

              H Offline
              H Offline
              HexaDeveloper
              wrote on last edited by
              #6

              hi Bitmap workSpaceBitmap = new Bitmap(tabctrlMain.SelectedTab.Width, tabctrlMain.SelectedTab.Height); tabctrlMain.SelectedTab.DrawToBitmap(workSpaceBitmap, tabctrlMain.SelectedTab.Bounds); workSpaceBitmap.Save("c:\\image.jpeg", ImageFormat.Jpeg); i write this code and thanx very much for ur help(DrawToBitmap u told me about it) thanx alot but one question if there is a scroll bar is this code will draw disappeared parts of screen to image or not Generator

              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