首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

C#中image方法无法使用

2013-11-23 
C#中image方法无法使用 求助使用了命名空间using System.Drawing.Imagingusing System.Drawing但在用Ima

C#中image方法无法使用 求助
使用了命名空间
using System.Drawing.Imaging;
using System.Drawing;
但在用
Image.FromStream方法时报错。就是image.没有这个方法提示,不知道怎么了只提示了Form1,Program和properties三个。

以下是报错:
Error1 The type or namespace name 'FromStream' does not exist in the namespace 'Image' (are you missing an assembly reference?)\\urbanscience.net\users\SHG\lqchen\Documents\Visual Studio 2010\Projects\Image\Image\Form1.cs11047 Image


请问怎么能解决。各路高手快来显灵吧。 C# ?Image类
[解决办法]
1、引用System.Drawing.dll;using System.Drawing;;Image.FromStream
2、修复一下vs。
[解决办法]
重名冲突引起的。因为你程序的命名空间恰好也是Image,只要换个命名空间就行了。
注意把红色部分换成其它名字。每个类都要换
    namespace Image
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new FmPointCurve());
        }
    }
[解决办法]

引用:
重名冲突引起的。因为你程序的命名空间恰好也是Image,只要换个命名空间就行了。
注意把红色部分换成其它名字。每个类都要换
    namespace Image
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new FmPointCurve());
        }
    }


应该是他的解决方案名字叫Image

热点排行