首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >AssetNotFoundException in SharpDX

AssetNotFoundException in SharpDX
EN

Stack Overflow用户
提问于 2014-09-28 19:33:33
回答 1查看 91关注 0票数 0

实际上,我正在尝试制作在窗口上显示一些图片的程序,这是代码的一部分

代码语言:javascript
运行
复制
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,但这是谎言,我有这个资产!

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-09-28 23:40:50

AssetNotFoundException,但这是骗人的,我有这个资产!

很可能您没有将您的纹理配置为构建的一部分。您需要在VS中设置纹理上的操作"ToolkitTexture“,并读取没有".jpg”的纹理Content.Load<Texture2D>("T"),就像在SharpDX示例中所做的那样。这将在您粘贴的代码的注释中解释。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/26088808

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档