Reputation: 16431
I selected console application as my C# project. But the imports that seemed to work under Windows Form project don't seem to work here. It says that the drawing namespace does not exist.
using System.Drawing;
using System.Drawing.Imaging;
My problem is that I need to have the bitmap class. I am trying to make a command line app that does bitmap manipulations to a image. That's why I didn't choose my project to be a Windows Form one.
Upvotes: 68
Views: 160503
Reputation: 716
Install this library from Nuget
System.Drawing.Common
https://www.nuget.org/packages/System.Drawing.Common/6.0.0
Upvotes: 9
Reputation: 17485
Target framework
.Net framework 4.0 Client Profile
then change it to .Net Framework 4.0
It works now
Upvotes: -12
Reputation: 887449
You need to add a reference to System.Drawing.dll
.
As mentioned in the comments below this can be done as follows: In your Solution Explorer (Where all the files are shown with your project), right click the "References" folder and find System.Drawing on the .NET Tab.
Upvotes: 218
Reputation: 2880
Add reference .dll file to project. Right, Click on Project reference folder --> click on Add Reference -->.Net tab you will find System.Drawing --> click on ok this will add a reference to System.Drawing
Upvotes: 2
Reputation: 325
Upvotes: 10
Reputation: 51
For,Adding System.Drawing Follow some steps: Firstly, right click on the solution and click on add Reference. Secondly, Select the .NET Folder. And then double click on the Using.System.Drawing;
Upvotes: 5
Reputation: 18290
If you are using Visual Studio 2010 or plus then check the target framework that is it .Net Framework 4.0 or .Net Framework 4.0 Client Profile. then change is to .Net Framework 4.0.
You need to add reference this .dll file (System.Drawing.dll) to perform drawing operations.
If it is OK then follow these steps to add reference to System.Drawing.dll
Solution Explorer
, right-click on the project node
and click Add Reference.
System.Drawing.dll
to reference, then click OK.Upvotes: 10