Maximus Posted March 28, 2012 Report Posted March 28, 2012 (edited) Am codul :Imports System.IOImports Microsoft.DirectX.Direct3DImports Microsoft.DirectXPublic Class form1 Public GraphicsDevice As Direct3D.Device = Nothing Public presentParams As PresentParameters = New PresentParameters Public Sub InitializeGraphics() Dim current As Format = Direct3D.Manager.Adapters(0).CurrentDisplayMode.Format presentParams.SwapEffect = SwapEffect.Discard presentParams.BackBufferFormat = current presentParams.Windowed = True presentParams.BackBufferHeight = 0 presentParams.BackBufferWidth = 0 GraphicsDevice = New Direct3D.Device(0, Direct3D.DeviceType.Hardware, Me, CreateFlags.SoftwareVertexProcessing, presentParams) End Sub Public Function CaptureScreenshot(ByVal Device As Direct3D.Device, ByVal Filename As String, ByVal ImageFormat As Direct3D.ImageFileFormat) As Boolean Dim Ssurface As Direct3D.Surface Dim current As Format = Direct3D.Manager.Adapters(0).CurrentDisplayMode.Format Ssurface = Device.GetBackBuffer(0, 0, BackBufferType.Mono) Direct3D.SurfaceLoader.Save(Filename, ImageFormat, Ssurface) Ssurface.Dispose() Return True End Function Private Sub Main_Load(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.Load Timer1.Enabled = True End Sub Dim cc As Integer = 1 Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick InitializeGraphics() CaptureScreenshot(GraphicsDevice, cc & ".bmp", ImageFileFormat.Bmp) cc += 1 End SubEnd ClassIncerc sa fac un screenshot cand joc battlefield 3. din cate am inteles doar folosind directx merge facut screenshot-ul.Cand dau Debug imi da :Error 2 'Device' is a type and cannot be used as an expression.Error 1 'DirectX' is not declared. It may be inaccessible due to its protection level. si nu inteleg dc.Ma poate ajuta cineva?? Multumesc anticipat.//Ok, am ajuns pana aici ... si tot nu merge Edited March 29, 2012 by Maximus Quote