Вопрос

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