我目前正在尝试使用XNA加载一个简单的位图,但我得到了以下错误:尝试加载一个位图,但XNA want'sa的Texture2D
Error loading "Maps\standard". File contains Microsoft.Xna.Framework.Graphics.Texture2D but trying to load as System.Drawing.Bitmap.
代码:
public Bitmap map;
public void load(Game game, String image) {
path = image; //path to image
map = game.Content.Load<Bitmap>("Maps/"+path);
sizeX = map.Width;
sizeY = map.Height;
}
你想用位图文件做一次加载哪些? – M4st3rM1nd 2013-04-29 19:32:21