   DirectX8 and screenshots
  I like to say hello its my first post in this forum:)I have a need to take screenshot from my game window. Its in DirectX8. To take screenshot i find this function:Quote:Public Function SaveScreenShot3D(dev As Direct3DDevice8, d3dx As D3DX8, strFileName As String) As Boolean    Dim Surf As Direct3DSurface8    Dim Palette As PALETTEENTRY    Dim r As RECT    Dim DispMode As D3DDISPLAYMODE    On Error GoTo errOut    dev.GetDisplayMode DispMode    Set Surf = dev.CreateImageSurface(DispMode.Width, DispMode.Height, D3DFMT_A8R8G8B8)    dev.GetFrontBuffer Surf    With r   .Left = 0   .Top = 0   .Right = DispMode.Width   .bottom = DispMode.Height    End With    d3dx.SaveSurfaceToFile strFileName, D3DXIFF_BMP, Surf, Palette, rSaveScreenShot3D = True    Exit FunctionerrOut:    SaveScreenShot3D = FalseEnd FunctionIts working ok, but it takes screen from all Windows + window of my game (its windowed game). How can i make it to save screen only game window device?Its Visual Basic 6.   
  I'm not familiar with DX8 for VB, but from the looks of it "r" is the rectangle structure that specifies how much of the front buffer (screen) surface information is saved to the file.  Currently the rectangle you've specified starts at the upper left-hand corner of the screen:With r.Left = 0.Top = 0and captures the entire width and height of the screen:.Right = DispMode.Width.bottom = DispMode.HeightIf you change your Left and Top values to match the upper left-most pixel of the canvas of the window you want to capture, and change Right and Bottom to be the width and height of that canvas, I would think it should work.;  Hi thank you for reply.I was trying to change that and only change values DispMode.Width and DispMode.Height have no effects.But i see this function its not realy like i want because its taking screens also if any window its up to my game window.So i wondering how to make screen only directly game window device.   ;  Anyone?   