Ambiguous reference between 'Microsoft.Xna.Framework.Color' & 'System.Drawing'

旧城冷巷雨未停 提交于 2019-12-11 15:00:04

问题


I think this is a simple question to answer, but I still can't figure out a way to get past it.

Basically, what I wanted, was to use a Bitmap object in my Xna game. So I went ahead and added System.Drawing as an assembly reference. This worked out perfectly, except that I now get a different error; "'Color' is an ambiguous reference between 'Microsoft.Xna.Framework.Color' and 'System.Drawing'. How do I get past this?


回答1:


The assembly reference alone doesn't lead to the error. It's the using that you've probably inserted, because it imports the whole namespace. You could try

using Bitmap = System.Drawing.Bitmap

instead to import the bitmap only.



来源:https://stackoverflow.com/questions/16998143/ambiguous-reference-between-microsoft-xna-framework-color-system-drawing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!