DirectX Game Screenshot

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Vedran Budimir
    New Member
    • Feb 2012
    • 1

    DirectX Game Screenshot

    Software: Visual Basic 2008
    My problem:
    I make a program for taking screenshots from the game, this is the current code that I use:

    Code:
    Dim bounds As Rectangle
                Dim screenshot As System.Drawing.Bitmap
                Dim graph As Graphics
                bounds = Screen.PrimaryScreen.Bounds
                screenshot = New System.Drawing.Bitmap(bounds.Width, bounds.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb)
                graph = Graphics.FromImage(screenshot)
                graph.CopyFromScreen(bounds.X, bounds.Y, 0, 0, bounds.Size, CopyPixelOperation.SourceCopy)
                PictureBox1.Image = screenshot
    and it works great when i need to take a desktop screenshot, but when i try take a game screenshot it does not work! I read on the internet and it says that I need to take screenshots from DirectX. The problem is that I never worked with DirectX and I need your help, any help is welcome if it is related to my problem, I would appreciate if you have some kind of example.





    Thank you!
Working...