문제

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