I am new to C# and I am trying to create a bitmap object in C# in Visual Studio 2019, but it isn't working. I have .NET Framework updated to the latest version and I have resharper installed. I am using Windows 10.
Ive tried adding the references manually with Add/Reference... and it does not stay checked.
I added using system.drawing and using system.drawing.common to the top of my code.
I updated my .net core and enabled it in my project.
using System; using System.Drawing.Common; namespace Bot { class Program { static void Main(string[] args) { var bmp = new Bitmap(); } } } I expected it to create a bitmap object, but it won't compile and gives me errors saying that the bitmap object does not exist in system.drawing.
System.Drawing.dll, read the instructions here.System.Drawing.CommonNuGet package? When you have, addusing System.Drawing;, then writevar bmp = new Bitmap(1, 1);(you need to specify a size or a source Image or a file path or a stream).Tools -> NuGet Package Manager - Manage NuGet Packages for Solution. SearchSystem.Drawing.Commonand install it, ticking all the checkboxes (Project) you find in the panel on the right.