日期:2014-05-17  浏览次数:21711 次

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

以下是报错:
Error 1 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.cs 110 47 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