【发布时间】:2014-09-29 07:40:50
【问题描述】:
我实际上是在尝试制作在窗口上显示一些图片的程序 这是部分代码
public Texture2D tulTexture;
//...
protected override void LoadContent()
{
// Instantiate a SpriteBatch
spriteBatch = ToDisposeContent(new SpriteBatch(GraphicsDevice));
// Loads the balls texture (32 textures (32x32) stored vertically => 32 x 1024 ).
// The [Balls.dds] file is defined with the build action [ToolkitTexture] in the project
tulTexture = this.Content.Load<Texture2D>("T.jpg");
// Loads a sprite font
// The [Arial16.xml] file is defined with the build action [ToolkitFont] in the project
base.LoadContent();
}
当我运行程序时,我得到了 AssetNotFoundException 但这是谎言。我有这个资产!
【问题讨论】:
-
请发布完整的 StackTrace。
-
不久前我遇到了同样的问题。进入 SharpDX 代码并观察它构建它试图打开的文件的路径是很有帮助的。我也从没有为图像文件设置正确的构建操作中看到这一点 - 它需要是 ToolkitTexture。
标签: sharpdx