当前位置: 首页>>代码示例>>C#>>正文


C# Device.GetRenderTarget方法代码示例

本文整理汇总了C#中SharpDX.Direct3D9.Device.GetRenderTarget方法的典型用法代码示例。如果您正苦于以下问题:C# Device.GetRenderTarget方法的具体用法?C# Device.GetRenderTarget怎么用?C# Device.GetRenderTarget使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SharpDX.Direct3D9.Device的用法示例。


在下文中一共展示了Device.GetRenderTarget方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DoCaptureRenderTarget

        /// <summary>
        /// Implementation of capturing from the render target of the Direct3D9 Device (or DeviceEx)
        /// </summary>
        /// <param name="device"></param>
        void DoCaptureRenderTarget(Device device, string hook)
        {
            this.Frame();
            
            try
            {
                #region Screenshot Request

                // If we have issued the command to copy data to our render target, check if it is complete
                bool qryResult;
                if (_queryIssued && _requestCopy != null && _query.GetData(out qryResult, false))
                {
                    // The GPU has finished copying data to _renderTargetCopy, we can now lock
                    // the data and access it on another thread.

                    _queryIssued = false;
                    
                    // Lock the render target
                    SharpDX.Rectangle rect;
                    SharpDX.DataRectangle lockedRect = LockRenderTarget(_renderTargetCopy, out rect);
                    _renderTargetCopyLocked = true;

                    // Copy the data from the render target
                    System.Threading.Tasks.Task.Factory.StartNew(() =>
                    {
                        lock (_lockRenderTarget)
                        {
                            ProcessCapture(rect.Width, rect.Height, lockedRect.Pitch, _renderTargetCopy.Description.Format.ToPixelFormat(), lockedRect.DataPointer, _requestCopy);
                        }
                    });
                }

                // Single frame capture request
                if (this.Request != null)
                {
                    DateTime start = DateTime.Now;
                    try
                    {
                        using (Surface renderTarget = device.GetRenderTarget(0))
                        {
                            int width, height;

                            // If resizing of the captured image, determine correct dimensions
                            if (Request.Resize != null && (renderTarget.Description.Width > Request.Resize.Value.Width || renderTarget.Description.Height > Request.Resize.Value.Height))
                            {
                                if (renderTarget.Description.Width > Request.Resize.Value.Width)
                                {
                                    width = Request.Resize.Value.Width;
                                    height = (int)Math.Round((renderTarget.Description.Height * ((double)Request.Resize.Value.Width / (double)renderTarget.Description.Width)));
                                }
                                else
                                {
                                    height = Request.Resize.Value.Height;
                                    width = (int)Math.Round((renderTarget.Description.Width * ((double)Request.Resize.Value.Height / (double)renderTarget.Description.Height)));
                                }
                            }
                            else
                            {
                                width = renderTarget.Description.Width;
                                height = renderTarget.Description.Height;
                            }

                            // If existing _renderTargetCopy, ensure that it is the correct size and format
                            if (_renderTargetCopy != null && (_renderTargetCopy.Description.Width != width || _renderTargetCopy.Description.Height != height || _renderTargetCopy.Description.Format != renderTarget.Description.Format))
                            {
                                // Cleanup resources
                                Cleanup();
                            }

                            // Ensure that we have something to put the render target data into
                            if (!_resourcesInitialised || _renderTargetCopy == null)
                            {
                                CreateResources(device, width, height, renderTarget.Description.Format);
                            }

                            // Resize from render target Surface to resolvedSurface (also deals with resolving multi-sampling)
                            device.StretchRectangle(renderTarget, _resolvedTarget, TextureFilter.None);
                        }

                        // If the render target is locked from a previous request unlock it
                        if (_renderTargetCopyLocked)
                        {
                            // Wait for the the ProcessCapture thread to finish with it
                            lock (_lockRenderTarget)
                            {
                                if (_renderTargetCopyLocked)
                                {
                                    _renderTargetCopy.UnlockRectangle();
                                    _renderTargetCopyLocked = false;
                                }
                            }
                        }
                            
                        // Copy data from resolved target to our render target copy
                        device.GetRenderTargetData(_resolvedTarget, _renderTargetCopy);

//.........这里部分代码省略.........
开发者ID:Soothsilver,项目名称:megajewel,代码行数:101,代码来源:DXHookD3D9.cs

示例2: DoCaptureRenderTarget

        /// <summary>
        /// Implementation of capturing from the render target of the Direct3D9 Device (or DeviceEx)
        /// </summary>
        /// <param name="device"></param>
        private void DoCaptureRenderTarget(Device device, string hook)
        {
            try
            {
                if (!this.surfacesSetup)
                {
                    using (Surface backbuffer = device.GetRenderTarget(0))
                    {
                        this.format = backbuffer.Description.Format;
                        this.width = backbuffer.Description.Width;
                        this.height = backbuffer.Description.Height;
                    }

                    this.SetupSurfaces(device);
                }

                if (!this.surfacesSetup)
                {
                    return;
                }

                this.HandleCaptureRequest(device);
            }
            catch (Exception e)
            {
                this.DebugMessage(e.ToString());
            }
        }
开发者ID:dEMonaRE,项目名称:HearthstoneTracker,代码行数:32,代码来源:DXHookD3D9.cs

示例3: DoCaptureRenderTarget

        /// <summary>
        ///     Implementation of capturing from the render target of the Direct3D9 Device (or DeviceEx)
        /// </summary>
        /// <param name="device"></param>
        private void DoCaptureRenderTarget(Device device, string hook)
        {
            Frame();

            try
            {
                #region Screenshot Request

                // If we have issued the command to copy data to our render target, check if it is complete
                bool qryResult;
                if (_queryIssued && _requestCopy != null && _query.GetData(out qryResult, false))
                {
                    // The GPU has finished copying data to _renderTargetCopy, we can now lock
                    // the data and access it on another thread.

                    _queryIssued = false;

                    // Lock the render target
                    Rectangle rect;
                    var lockedRect = LockRenderTarget(_renderTargetCopy, out rect);
                    _renderTargetCopyLocked = true;

                    // Copy the data from the render target
                    Task.Factory.StartNew(() =>
                    {
                        lock (_lockRenderTarget)
                        {
                            ProcessCapture(rect.Width, rect.Height, lockedRect.Pitch,
                                _renderTargetCopy.Description.Format.ToPixelFormat(), lockedRect.DataPointer,
                                _requestCopy);
                        }
                    });
                }

                // Single frame capture request
                if (Request != null)
                {
                    var start = DateTime.Now;
                    try
                    {
                        using (var renderTarget = device.GetRenderTarget(0))
                        {
                            int width, height;

                            // If resizing of the captured image, determine correct dimensions
                            if (Request.Resize != null &&
                                (renderTarget.Description.Width > Request.Resize.Value.Width ||
                                 renderTarget.Description.Height > Request.Resize.Value.Height))
                            {
                                if (renderTarget.Description.Width > Request.Resize.Value.Width)
                                {
                                    width = Request.Resize.Value.Width;
                                    height =
                                        (int)
                                            Math.Round((renderTarget.Description.Height*
                                                        (Request.Resize.Value.Width/
                                                         (double) renderTarget.Description.Width)));
                                }
                                else
                                {
                                    height = Request.Resize.Value.Height;
                                    width =
                                        (int)
                                            Math.Round((renderTarget.Description.Width*
                                                        (Request.Resize.Value.Height/
                                                         (double) renderTarget.Description.Height)));
                                }
                            }
                            else
                            {
                                width = renderTarget.Description.Width;
                                height = renderTarget.Description.Height;
                            }

                            // If existing _renderTargetCopy, ensure that it is the correct size and format
                            if (_renderTargetCopy != null &&
                                (_renderTargetCopy.Description.Width != width ||
                                 _renderTargetCopy.Description.Height != height ||
                                 _renderTargetCopy.Description.Format != renderTarget.Description.Format))
                            {
                                // Cleanup resources
                                Cleanup();
                            }

                            // Ensure that we have something to put the render target data into
                            if (!_resourcesInitialised || _renderTargetCopy == null)
                            {
                                CreateResources(device, width, height, renderTarget.Description.Format);
                            }

                            // Resize from render target Surface to resolvedSurface (also deals with resolving multi-sampling)
                            device.StretchRectangle(renderTarget, _resolvedTarget, TextureFilter.None);
                        }

                        // If the render target is locked from a previous request unlock it
                        if (_renderTargetCopyLocked)
//.........这里部分代码省略.........
开发者ID:nefarius,项目名称:Direct3DHook,代码行数:101,代码来源:DXHookD3D9.cs

示例4: DoCaptureRenderTarget

        /// <summary>
        /// Implementation of capturing from the render target of the Direct3D9 Device (or DeviceEx)
        /// </summary>
        /// <param name="device"></param>
        private void DoCaptureRenderTarget(Device device, string hook)
        {
            // this.Frame();

            try
            {
                if (!surfacesSetup)
                {
                    using (Surface backbuffer = device.GetRenderTarget(0))
                    {
                        format = backbuffer.Description.Format;
                        width = backbuffer.Description.Width;
                        height = backbuffer.Description.Height;
                    }

                    SetupSurfaces(device);
                }

                if (!surfacesSetup)
                {
                    return;
                }

                if (Request != null)
                {
                    HandleCaptureRequest(device);
                }
            }
            catch (Exception e)
            {
                DebugMessage(e.ToString());
            }
        }
开发者ID:remcoros,项目名称:Direct3DHook,代码行数:37,代码来源:DXHookD3D9.cs

示例5: DoCaptureRenderTarget

        /// <summary>
        /// Implementation of capturing from the render target of the Direct3D9 Device (or DeviceEx)
        /// </summary>
        /// <param name="device"></param>
        void DoCaptureRenderTarget(Device device, string hook)
        {
            this.Frame();

            try
            {
                    #region Screenshot Request
                // Single frame capture request
                if (this.Request != null)
                {
                    DateTime start = DateTime.Now;
                    try
                    {

                        using (Surface renderTargetTemp = device.GetRenderTarget(0))
                        {
                            int width, height;

                            // TODO: If resizing the captured image is required it can be adjusted here
                            //if (renderTargetTemp.Description.Width > 1280)
                            //{
                            //    width = 1280;
                            //    height = (int)Math.Round((renderTargetTemp.Description.Height * (1280.0 / renderTargetTemp.Description.Width)));
                            //}
                            //else
                            {
                                width = renderTargetTemp.Description.Width;
                                height = renderTargetTemp.Description.Height;
                            }

                            // First ensure we have a Surface to the render target data into
                            if (_renderTarget == null)
                            {
                                // Create offscreen surface to use as copy of render target data
                                using (SwapChain sc = device.GetSwapChain(0))
                                {
                                    _renderTarget = Surface.CreateOffscreenPlain(device, width, height, sc.PresentParameters.BackBufferFormat, Pool.SystemMemory);
                                }
                            }

                            // Create our resolved surface (resizing if necessary and to resolve any multi-sampling)
                            using (Surface resolvedSurface = Surface.CreateRenderTarget(device, width, height, renderTargetTemp.Description.Format, MultisampleType.None, 0, false))
                            {
                                // Resize from Render Surface to resolvedSurface
                                device.StretchRectangle(renderTargetTemp, resolvedSurface, TextureFilter.None);

                                // Get Render Data
                                device.GetRenderTargetData(resolvedSurface, _renderTarget);
                            }
                        }

                        if (Request != null)
                            ProcessRequest();
                    }
                    finally
                    {
                        // We have completed the request - mark it as null so we do not continue to try to capture the same request
                        // Note: If you are after high frame rates, consider implementing buffers here to capture more frequently
                        //         and send back to the host application as needed. The IPC overhead significantly slows down 
                        //         the whole process if sending frame by frame.
                        Request = null;
                    }
                    DateTime end = DateTime.Now;
                    this.DebugMessage(hook + ": Capture time: " + (end - start).ToString());
                }

                #endregion

                if (this.Config.ShowOverlay)
                {
                    #region Draw frame rate

                    // TODO: font needs to be created and then reused, not created each frame!
                    using (SharpDX.Direct3D9.Font font = new SharpDX.Direct3D9.Font(device, new FontDescription()
                                    {
                                        Height = 16,
                                        FaceName = "Arial",
                                        Italic = false,
                                        Width = 0,
                                        MipLevels = 1,
                                        CharacterSet = FontCharacterSet.Default,
                                        OutputPrecision = FontPrecision.Default,
                                        Quality = FontQuality.Antialiased,
                                        PitchAndFamily = FontPitchAndFamily.Default | FontPitchAndFamily.DontCare,
                                        Weight = FontWeight.Bold
                                    }))
                    {

                        if (this.FPS.GetFPS() >= 1)
                        {
                            font.DrawText(null, String.Format("{0:N0} fps", this.FPS.GetFPS()), 5, 5, SharpDX.Color.Red);
                        }

                        if (this.TextDisplay != null && this.TextDisplay.Display)
                        {
                            font.DrawText(null, this.TextDisplay.Text, 5, 25, new SharpDX.ColorBGRA(255, 0, 0, (byte)Math.Round((Math.Abs(1.0f - TextDisplay.Remaining) * 255f))));
//.........这里部分代码省略.........
开发者ID:Csharper1972,项目名称:Direct3DHook,代码行数:101,代码来源:DXHookD3D9.cs

示例6: DoCaptureRenderTarget

        /// <summary>
        /// Implementation of capturing from the render target of the Direct3D9 Device (or DeviceEx)
        /// </summary>
        /// <param name="device"></param>
        void DoCaptureRenderTarget(Device device, string hook)
        {
            this.Frame();

            try
            {
                #region Screenshot Request

                // If we have issued the command to copy data to our render target, check if it is complete
                bool qryResult;
                if (_queryIssued && _requestCopy != null && _query.GetData(out qryResult, false))
                {
                    // The GPU has finished copying data to _renderTargetCopy, we can now lock
                    // the data and access it on another thread.

                    _queryIssued = false;

                    // Lock the render target
                    SharpDX.Rectangle rect;
                    SharpDX.DataRectangle lockedRect = LockRenderTarget(_renderTargetCopy, out rect);
                    _renderTargetCopyLocked = true;

                    // Copy the data from the render target
                    System.Threading.Tasks.Task.Factory.StartNew(() =>
                    {
                        lock (_lockRenderTarget)
                        {
                            ProcessCapture(rect.Width, rect.Height, lockedRect.Pitch, _renderTargetCopy.Description.Format.ToPixelFormat(), lockedRect.DataPointer, _requestCopy);
                        }
                    });
                }

                // Single frame capture request
                if (this.Request != null)
                {
                    DateTime start = DateTime.Now;
                    try
                    {
                        using (Surface renderTarget = device.GetRenderTarget(0))
                        {
                            int width, height;

                            // If resizing of the captured image, determine correct dimensions
                            if (Request.Resize != null && (renderTarget.Description.Width > Request.Resize.Value.Width || renderTarget.Description.Height > Request.Resize.Value.Height))
                            {
                                if (renderTarget.Description.Width > Request.Resize.Value.Width)
                                {
                                    width = Request.Resize.Value.Width;
                                    height = (int)Math.Round((renderTarget.Description.Height * ((double)Request.Resize.Value.Width / (double)renderTarget.Description.Width)));
                                }
                                else
                                {
                                    height = Request.Resize.Value.Height;
                                    width = (int)Math.Round((renderTarget.Description.Width * ((double)Request.Resize.Value.Height / (double)renderTarget.Description.Height)));
                                }
                            }
                            else
                            {
                                width = renderTarget.Description.Width;
                                height = renderTarget.Description.Height;
                            }

                            // If existing _renderTargetCopy, ensure that it is the correct size and format
                            if (_renderTargetCopy != null && (_renderTargetCopy.Description.Width != width || _renderTargetCopy.Description.Height != height || _renderTargetCopy.Description.Format != renderTarget.Description.Format))
                            {
                                // Cleanup resources
                                Cleanup();
                            }

                            // Ensure that we have something to put the render target data into
                            if (!_resourcesInitialised || _renderTargetCopy == null)
                            {
                                CreateResources(device, width, height, renderTarget.Description.Format);
                            }

                            // Resize from render target Surface to resolvedSurface (also deals with resolving multi-sampling)
                            device.StretchRectangle(renderTarget, _resolvedTarget, TextureFilter.None);
                        }

                        // If the render target is locked from a previous request unlock it
                        if (_renderTargetCopyLocked)
                        {
                            // Wait for the the ProcessCapture thread to finish with it
                            lock (_lockRenderTarget)
                            {
                                if (_renderTargetCopyLocked)
                                {
                                    _renderTargetCopy.UnlockRectangle();
                                    _renderTargetCopyLocked = false;
                                }
                            }
                        }

                        // Copy data from resolved target to our render target copy
                        device.GetRenderTargetData(_resolvedTarget, _renderTargetCopy);

//.........这里部分代码省略.........
开发者ID:uGiFarukh,项目名称:Direct3DHook,代码行数:101,代码来源:DXHookD3D9.cs

示例7: DoCaptureRenderTarget

        /// <summary>
        ///     Implementation of capturing from the render target of the Direct3D9 Device (or DeviceEx)
        /// </summary>
        /// <param name="device"></param>
        private void DoCaptureRenderTarget(Device device, string hook)
        {
            try
            {
                if (!_surfacesSetup)
                {
                    using (var backbuffer = device.GetRenderTarget(0))
                    {
                        _copyData.format = (int)backbuffer.Description.Format;
                        _copyData.width = backbuffer.Description.Width;
                        _copyData.height = backbuffer.Description.Height;
                    }

                    SetupSurfaces(device);
                }

                if (!_surfacesSetup)
                {
                    return;
                }

                HandleCaptureRequest(device);
            }
            catch (Exception e)
            {
                DebugMessage(e.ToString());
            }
        }
开发者ID:ProjectTako,项目名称:HearthstoneTracker,代码行数:32,代码来源:DXHookD3D9SharedMem.cs

示例8: DoCaptureRenderTarget

        /// <summary>
        ///     Implementation of capturing from the render target of the Direct3D9 Device (or DeviceEx)
        /// </summary>
        /// <param name="device"></param>
        private void DoCaptureRenderTarget(Device device, string hook)
        {
            try
            {
                if (!_surfacesSetup)
                {
                    using (var backbuffer = device.GetRenderTarget(0))
                    {
                        _format = backbuffer.Description.Format;
                        _width = backbuffer.Description.Width;
                        _height = backbuffer.Description.Height;
                    }

                    SetupSurfaces(device);
                }

                if (!_surfacesSetup)
                {
                    return;
                }

                if (Request != null)
                {
                    try
                    {
                        _lastRequestId = Request.RequestId;
                        HandleCaptureRequest(device);
                    }
                    finally
                    {
                        Request.Dispose();
                        Request = null;
                    }
                }
            }
            catch (Exception e)
            {
                DebugMessage(e.ToString());
            }
        }
开发者ID:ProjectTako,项目名称:HearthstoneTracker,代码行数:44,代码来源:DXHookD3D9Simple.cs

示例9: DoCaptureRenderTarget

        /// <summary>
        /// Implementation of capturing from the render target of the Direct3D9 Device (or DeviceEx)
        /// </summary>
        /// <param name="device"></param>
        void DoCaptureRenderTarget(Device device, string hook)
        {
            try
            {
                #region Screenshot Request

                // Single frame capture request
                if (this.Request != null)
                {
                    DateTime start = DateTime.Now;
                    try
                    {

                        using (Surface renderTargetTemp = device.GetRenderTarget(0))
                        {
                            int width, height;

                            // TODO: If resizing the captured image is required it can be adjusted here
                            //if (renderTargetTemp.Description.Width > 1280)
                            //{
                            //    width = 1280;
                            //    height = (int)Math.Round((renderTargetTemp.Description.Height * (1280.0 / renderTargetTemp.Description.Width)));
                            //}
                            //else
                            {
                                width = renderTargetTemp.Description.Width;
                                height = renderTargetTemp.Description.Height;
                            }

                            // First ensure we have a Surface to the render target data into
                            if (_renderTarget == null)
                            {
                                // Create offscreen surface to use as copy of render target data
                                using (SwapChain sc = device.GetSwapChain(0))
                                {
                                    _renderTarget = Surface.CreateOffscreenPlain(device, width, height,
                                        sc.PresentParameters.BackBufferFormat, Pool.SystemMemory);
                                }
                            }

                            // Create our resolved surface (resizing if necessary and to resolve any multi-sampling)
                            using (
                                Surface resolvedSurface = Surface.CreateRenderTarget(device, width, height,
                                    renderTargetTemp.Description.Format, MultisampleType.None, 0, false))
                            {
                                // Resize from Render Surface to resolvedSurface
                                device.StretchRectangle(renderTargetTemp, resolvedSurface, TextureFilter.None);

                                // Get Render Data
                                device.GetRenderTargetData(resolvedSurface, _renderTarget);
                            }
                        }

                        if (Request != null)
                            ProcessRequest();
                    }
                    finally
                    {
                        // We have completed the request - mark it as null so we do not continue to try to capture the same request
                        // Note: If you are after high frame rates, consider implementing buffers here to capture more frequently
                        //         and send back to the host application as needed. The IPC overhead significantly slows down
                        //         the whole process if sending frame by frame.
                        Request = null;
                    }
                    DateTime end = DateTime.Now;
                    this.DebugMessage(hook + ": Capture time: " + (end - start).ToString());
                }

                #endregion

                if (this.Config.ShowOverlay)
                {

                    // SHIT
                    this.Frame();

                    #region Draw frame rate

                    // TODO: font needs to be created and then reused, not created each frame!

                    using (var font = new SharpDX.Direct3D9.Font(device, new FontDescription()
                    {
                        Height = 26,
                        FaceName = "Quartz MS",
                        Italic = false,
                        Width = 0,
                        MipLevels = 1,
                        CharacterSet = FontCharacterSet.Default,
                        OutputPrecision = FontPrecision.Default,
                        Quality = FontQuality.Antialiased,
                        PitchAndFamily = FontPitchAndFamily.Default | FontPitchAndFamily.DontCare,
                        Weight = FontWeight.Normal
                    }))
                    {

                    // Make a Texture from a file...
//.........这里部分代码省略.........
开发者ID:Kriosym,项目名称:JungleTimers,代码行数:101,代码来源:DXHookD3D9.cs

示例10: DoCaptureRenderTarget

        private void DoCaptureRenderTarget(Device device, string hook)
        {
            try
            {
                if (isCapturing && signalEnd.WaitOne(0))
                {
                    ClearD3D9Data();
                    isCapturing = false;
                    stopRequested = true;
                }

                if (!isCapturing)
                {
                    return;
                }

                if (!bHasTextures)
                {
                    using (Surface backbuffer = device.GetRenderTarget(0))
                    {
                        copyData.format = (int)backbuffer.Description.Format;
                        copyData.width = backbuffer.Description.Width;
                        copyData.height = backbuffer.Description.Height;
                    }
                    DoD3DHooks(device);
                }

                if (!bHasTextures)
                {
                    return;
                }

                long timeVal = DateTime.Now.Ticks;
                long frameTime = 1000000 / targetFps; // lock at 30 fps
                if (frameTime != 0)
                {
                    for (var i = 0; i < NUM_BUFFERS; i++)
                    {
                        if (issuedQueries[i])
                        {
                            bool tmp;
                            if (queries[i].GetData(out tmp, false))
                            {
                                issuedQueries[i] = false;

                                Surface targetTexture = textures[i];
                                try
                                {
                                    var lockedRect = targetTexture.LockRectangle(LockFlags.ReadOnly);
                                    pCopyData = lockedRect.DataPointer;

                                    curCPUTexture = i;
                                    lockedTextures[i] = true;
                                    hCopyEvent.Set();
                                }
                                catch (Exception ex)
                                {
                                    DebugMessage(ex.ToString());
                                }
                            }
                        }
                    }

                    long timeElapsed = timeVal - lastTime;
                    if (timeElapsed >= frameTime)
                    {
                        lastTime += frameTime;
                        if (timeElapsed > frameTime * 2)
                        {
                            lastTime = timeVal;
                        }

                        var nextCapture = (curCapture == NUM_BUFFERS - 1) ? 0 : (curCapture + 1);

                        Surface sourceTexture = copyD3D9Textures[curCapture];
                        using (var backbuffer = device.GetBackBuffer(0, 0))
                        {
                            device.StretchRectangle(backbuffer, sourceTexture, TextureFilter.None);
                        }
                        if (copyWait < (NUM_BUFFERS - 1))
                        {
                            copyWait++;
                        }
                        else
                        {
                            Surface prevSourceTexture = copyD3D9Textures[nextCapture];
                            Surface targetTexture = textures[nextCapture];

                            if (lockedTextures[nextCapture])
                            {
                                Monitor.Enter(dataMutexes[nextCapture]);

                                targetTexture.UnlockRectangle();
                                lockedTextures[nextCapture] = false;

                                Monitor.Exit(dataMutexes[nextCapture]);
                            }
                            try
                            {
                                device.GetRenderTargetData(prevSourceTexture, targetTexture);
//.........这里部分代码省略.........
开发者ID:Icehunter,项目名称:Direct3DCapture,代码行数:101,代码来源:DxHookD3D9Obs.cs


注:本文中的SharpDX.Direct3D9.Device.GetRenderTarget方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。