关于您的Queston是DiurectX的屏幕截图. [英] Queston about you're DiurectX Screen shot.

查看:159
本文介绍了关于您的Queston是DiurectX的屏幕截图.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

extern IDirect3DDevice9* g_pd3dDevice;

void MainFrame::TakeScreenShot()
{
   // F***ing find a way to do this alreadY GRR O_O
   IDirect3DSurface9* pSurface;
   g_pd3dDevice->CreateOffscreenPlainSurface(800, 600,D3DFMT_A8R8G8B8, D3DPOOL_SCRATCH, &pSurface, NULL);
   g_pd3dDevice->GetFrontBufferData(0, pSurface);
   D3DXSaveSurfaceToFile("Desktop.bmp",D3DXIFF_BMP,pSurface,NULL,NULL);
   pSurface->Release();
}



尽管出现两个错误,但我在这个网站上有人正在使用这种方法.

C:/Users/dL-Tower/Desktop/DLAS 3.0.0/DLAS/MainFrame.cpp:81:错误:未在此范围内声明``D3DXIFF_BMP''

C:/Users/dL-Tower/Desktop/DLAS 3.0.0/DLAS/MainFrame.cpp:81:错误:未在此范围内声明``D3DXSaveSurfaceToFile''


我将其包含在我的.h文件中:)


//直接x
#include< d3d9.h>
#include< d3d9types.h>
#include< d3d9caps.h>


我正在使用Qt和C ++



I''m using this methode someone on this web site as writtten though I get two errors.

C:/Users/dL-Tower/Desktop/DLAS 3.0.0/DLAS/MainFrame.cpp:81: error: ''D3DXIFF_BMP'' was not declared in this scope

C:/Users/dL-Tower/Desktop/DLAS 3.0.0/DLAS/MainFrame.cpp:81: error: ''D3DXSaveSurfaceToFile'' was not declared in this scope


Im including this in my .h file :)


// direct x
#include <d3d9.h>
#include <d3d9types.h>
#include <d3d9caps.h>


I am using Qt and C++

推荐答案

对于D3DX *函数,您需要d3d9x *包含(并与d3dx9.lib链接).
试试:#include <d3dx9tex.h>
For D3DX* functions, you need the d3d9x* includes (and to link with the d3dx9.lib).

Try: #include <d3dx9tex.h>


这篇关于关于您的Queston是DiurectX的屏幕截图.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆