I’m making a new Project which is a class library.

my problem is I always got this error:
The type or namespace name 'Drawing'
does not exist in the namespace 'System' (are you missing an assembly reference?)
this is my code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
namespace ClassLibrary1
{
public class Class1
{
public void ReturnImage(object imageStream)
{
try
{
byte[] data = (byte[])imageStream;
MemoryStream ms = new MemoryStream(data);
return Image.FromStream(ms);
}
catch
{
}
}
}
}
I’m planning to use this class to serve as a repository of common methods that I will be reusing in my program. In the above code, I have a public method ReturnImage which supposedly will accept an object and returns an Image.
But why I get that error? Please help…
Add reference to System.Drawing
From VS menu: Project > Add Reference
And to save you from incessant typing of:
using namespacehere;Press
Ctrl+.(Control and .), it will automatically insertusing namespacehere;on top of your code based on the classes you use. Example, place the cursor on any character insideImageofImage.FromStream, then pressCtrl+., it will automatically insertusing System.Drawing;on top of your code. Likewise, do the same(pressingCtrl+.) onFromStreamofImage.FromStream, it will automatically insertusing System.IO;on top of your code