I am trying to declare and initialize a Bitmap in C#, but it does not seem to find the library. It just tells me to create the Bitmap class. Even by adding "using System.Drawing" manually has no effect.

using System.Drawing

...

Bitmap img = new Bitmap(500, 500);

Any ideas? I am using the .NET Framework 4.5, and according to Microsoft:

.NET Framework
Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

If it is deprecated, how can I create a Bitmap in C# using the .Net Framework 4.5?

有帮助吗?

解决方案

You also need to add a reference to the assembly it's defined in; namely, System.Drawing.dll.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top