Create image or bitmap in console application - can't seem to find System.Drawing?

I am trying to create an image or bitmap from the camera bitstream, which I (hopefully) will go to the browser through websocket. The application I am creating is a console application, because I did not think that this application would require a graphical interface. Now I am having problems creating / accessing the Image and Bitmap classes. System.Drawing doesn't seem to exist, and I don't know why. When I try using System.Drawing , I get the error The type or namespace name 'Drawing' does not exist in the namespace 'System' (are you missing an assembly reference?) What is the best way to create a bitmap in a console application, and is there any reason why i can't seem to load System.Drawing?

Code:

 private void Kinect_ColorFrameReady(object sender, ColorImageFrameReadyEventArgs e) { using (ColorImageFrame frame = e.OpenColorImageFrame()) { if (frame != null) { byte[] pixelData = new byte[frame.PixelDataLength]; frame.CopyPixelDataTo(pixelData); //how do we create a bitmap here and pass it off to chrome? } } } 
+4
source share
3 answers

You must add a link to the system.Drawing.Dll file in your project.

Right-click Project, add the link and find System.Drawing.DLL and add the link.

EDIT: You will find it in the Assemblies-> Frames-> System section. Development

+19
source

Add System.Drawing.dll as a reference assembly in your project.

+3
source

include System.Drawing.dll in the link 1) you can download it from http://www.dllme.com/dll/download/7139/System.Drawing.dll

0
source

All Articles