呈现BMP,JPEG,或PNG图像与DirectX? [英] Render a BMP, JPEG, or PNG Image with DirectX?

查看:505
本文介绍了呈现BMP,JPEG,或PNG图像与DirectX?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你如何呈现在Windows中3D为BMP,JPEG或PNG图像文件与DirectX? (例如,让我们说,我想渲染四象,使他们看起来像一个小隔间或什么的。)

How do you render a BMP, JPEG, or PNG image file in 3D with DirectX in Windows? (E.g. let's say I want to render four images so that they look like a cubicle or something.)

我见过很容易地与Java OpenGL库(JME我觉得呢?)这个工作,但似乎需要DirectX的纹理,并没有考虑在常规的图像。 :(

I've seen this done easily with a Java OpenGL library (JME I think?), but it seems like DirectX needs textures, and doesn't take in regular images. :(

这是正确的?如果是这样,我怎么把它转换成一个纹理编程?

Is this correct? If so, how do I convert it to a texture programmatically?

推荐答案

的DirectX 9的 D3DXCreateTextureFromFile

DirectX 9: D3DXCreateTextureFromFile

的DirectX 10: D3DX10CreateTextureFromFile 和< A HREF =htt​​p://msdn.microsoft.com/en-us/library/bb172667%28v=VS.85%29.aspx相对=nofollow> D3DX10CreateShaderResourceViewFromFile

DirectX 10: D3DX10CreateTextureFromFile and D3DX10CreateShaderResourceViewFromFile

的DirectX 11: D3DX11CreateTextureFromFile D3DX11CreateShaderResourceViewFromFile

DirectX 11: D3DX11CreateTextureFromFile and D3DX11CreateShaderResourceViewFromFile

阅读每一个细节,但最重要的是流行的文件格式都支持。 (包括BMP,JPG和PNG)

Read the details of each, but most all of the popular file formats are supported. (includes BMP, JPG, and PNG)

去这里: http://www.jblearning.com/catalog/9781598220537/

从样本和资源部分下载源$ C ​​$ C第二部分。看第7章源$ C ​​$ C样本。或者,你可以购买这本书。

Download the "source code part II" from the "samples and resources" section. Look at the chapter 7 source code samples. Optionally, you could buy the book.

这篇关于呈现BMP,JPEG,或PNG图像与DirectX?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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