当前位置:网站首页>D3D10 screenshot function saves texture to local
D3D10 screenshot function saves texture to local
2022-06-22 05:57:00 【Wangjianbo 09】
Date 20200311 By Wjb
Go straight to the code :
ID3D10Resource* pScreen;
mRenderTargetView->GetResource(&pScreen);
D3D10_TEXTURE2D_DESC texDesc;
texDesc.ArraySize = 1;
texDesc.CPUAccessFlags = 0;
texDesc.Width = (unsigned int)mClientWidth;
texDesc.Height = (unsigned int)mClientHeight;;
texDesc.SampleDesc.Count = 8;
texDesc.SampleDesc.Quality = 0;
texDesc.ArraySize = 1;
texDesc.MipLevels = 1;
texDesc.Format = DXGI_FORMAT_R8G8B8A8_TYPELESS;
texDesc.SampleDesc.Count = 1;
texDesc.SampleDesc.Quality = 0;
texDesc.Usage = D3D10_USAGE_DEFAULT;
texDesc.BindFlags = D3D10_BIND_SHADER_RESOURCE;
ID3D10Texture2D *texture;
HRESULT hr = md3dDevice->CreateTexture2D(&texDesc, 0, &texture);
md3dDevice->CopyResource(texture, pScreen);
char filename [245];
sprintf(filename, "TestFile%d.dds", name);
hr = D3DX10SaveTextureToFileA(texture, D3DX10_IFF_DDS, filename);
texture->Release();
pScreen->Release();I keep things DDS Format file , stay VS The opening effect in is shown in the following figure

I attached the function source code , Environmental Science VS2013 d3d10. Download address :
边栏推荐
- Data storage (Advanced)
- Use and decoupling of the mobile terminal's realm database, and use OC realm safely across threads
- vscode 远程连接错误:Server status check failed - waiting and retrying
- An unordered array of N integers. Find the first number after each element that is larger than it. The time complexity is O (n)
- U disk as startup disk to reinstall win10 system (no other software required)
- 空调(春季每日一题 50)
- 400-哈希表(1. 两数之和、454. 四数相加 II、383. 赎金信)
- 以太网通信协议
- CLion安装下载
- open source hypervisor
猜你喜欢

n个整数的无序数组,找到每个元素后面比它大的第一个数,要求时间复杂度为O(N)

以太网UDP帧发包设计

vscode 远程连接错误:Server status check failed - waiting and retrying

Server PHP related web page development environment construction

u盘作为启动盘重装win10系统(无需其他软件)

Beifeng helps Nanchang Emergency Management Bureau to build a public-private integrated emergency communication guarantee network

EPP (enhanced parallel port)

I2C interface

C指針的理解

數據的存儲(進階)
随机推荐
mysql基础面试题
n个整数的无序数组,找到每个元素后面比它大的第一个数,要求时间复杂度为O(N)
MFC Tab 控件添加 icon 图标
Signal output library
Market development trend forecast and investment risk outlook report of China's silicon carbide industry 2022-2027
Mobile terminal layout adaptation
Go language uses zap log Library
Reptile initial and project
Development prospect and investment potential prediction report of China's rare earth permanent magnet industry during the "14th five year plan" period 2022-2027
Golang Viper库入门教学
Sourcetree reported an error SSH failure
Remove then add string from variable of Makefile
电热水壶坏了别扔,它很容易修好的!
I don't suggest you work too hard
CLion安装下载
Beifeng helps Nanchang Emergency Management Bureau to build a public-private integrated emergency communication guarantee network
OPTEE notes
Ethernet UDP frame contract design
机器学习笔记 七:强大的神经网络表述
Unity 加密ASE 游戏数据