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. Capturing screenshots from games

Capturing screenshots from games

Scheduled Pinned Locked Moved C#
graphicsgame-devhelp
7 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.
  • S Offline
    S Offline
    SimpleData
    wrote on last edited by
    #1

    Hi I need to capture screenshots from DirectX games. I am using this code but sometimes I get totally blank images or the image of the desktop (but the game is open)

    int screenWidth = Screen.GetBounds(new Point(0, 0)).Width;
    int screenHeight = Screen.GetBounds(new Point(0, 0)).Height;
    Bitmap bmpScreenShot = new Bitmap(screenWidth, screenHeight);
    Graphics gfx = Graphics.FromImage((Image)bmpScreenShot);
    gfx.CopyFromScreen(0, 0, 0, 0, new Size(screenWidth, screenHeight));
    bmpScreenShot.Save("test.jpg", ImageFormat.Jpeg);

    I really need help. Thanks.

    L 1 Reply Last reply
    0
    • S SimpleData

      Hi I need to capture screenshots from DirectX games. I am using this code but sometimes I get totally blank images or the image of the desktop (but the game is open)

      int screenWidth = Screen.GetBounds(new Point(0, 0)).Width;
      int screenHeight = Screen.GetBounds(new Point(0, 0)).Height;
      Bitmap bmpScreenShot = new Bitmap(screenWidth, screenHeight);
      Graphics gfx = Graphics.FromImage((Image)bmpScreenShot);
      gfx.CopyFromScreen(0, 0, 0, 0, new Size(screenWidth, screenHeight));
      bmpScreenShot.Save("test.jpg", ImageFormat.Jpeg);

      I really need help. Thanks.

      L Offline
      L Offline
      leckey 0
      wrote on last edited by
      #2

      Been awhile since I have done screen shots, but I grabbed this from MSDN. http://msdn.microsoft.com/en-us/library/bb153278(VS.85).aspx[^]

      Back in the blog beatch! http://CraptasticNation.blogspot.com/[^]

      S 1 Reply Last reply
      0
      • L leckey 0

        Been awhile since I have done screen shots, but I grabbed this from MSDN. http://msdn.microsoft.com/en-us/library/bb153278(VS.85).aspx[^]

        Back in the blog beatch! http://CraptasticNation.blogspot.com/[^]

        S Offline
        S Offline
        SimpleData
        wrote on last edited by
        #3

        I have seen that code but I thought it was to use on your own DirectX application to save a screenshot of your own DirectX application. Can you tell me how to use that code? Thanks.

        L 1 Reply Last reply
        0
        • S SimpleData

          I have seen that code but I thought it was to use on your own DirectX application to save a screenshot of your own DirectX application. Can you tell me how to use that code? Thanks.

          L Offline
          L Offline
          leckey 0
          wrote on last edited by
          #4

          I'm at work so not much time right now, but here are a couple of links that I hope may help you out further! http://www.developerfusion.com/code/4630/capture-a-screen-shot/[^] DirectX.Capture Class Library[^]

          Back in the blog beatch! http://CraptasticNation.blogspot.com/[^]

          S 1 Reply Last reply
          0
          • L leckey 0

            I'm at work so not much time right now, but here are a couple of links that I hope may help you out further! http://www.developerfusion.com/code/4630/capture-a-screen-shot/[^] DirectX.Capture Class Library[^]

            Back in the blog beatch! http://CraptasticNation.blogspot.com/[^]

            S Offline
            S Offline
            SimpleData
            wrote on last edited by
            #5

            Thank you, I am looking into those links.

            L 1 Reply Last reply
            0
            • S SimpleData

              Thank you, I am looking into those links.

              L Offline
              L Offline
              leckey 0
              wrote on last edited by
              #6

              Please let the forum and I know if any of those helped; that way if the question comes up again we can reference those links. Thanks! leckey

              Back in the blog beatch! http://CraptasticNation.blogspot.com/[^]

              S 1 Reply Last reply
              0
              • L leckey 0

                Please let the forum and I know if any of those helped; that way if the question comes up again we can reference those links. Thanks! leckey

                Back in the blog beatch! http://CraptasticNation.blogspot.com/[^]

                S Offline
                S Offline
                SimpleData
                wrote on last edited by
                #7

                None of those links worked. :(

                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