12

I'm trying to create an image or bitmap from a camera bitstream that I will be (hopefully) passing to the browser via a websocket. The application I'm building is a console app as I didn't think there would be a need for this app to have a GUI. Now I'm having trouble creating/accessing Image and Bitmap classes - System.Drawing doesn't seem to exist and I'm not sure 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's the best way to create a bitmap in a console application, and is there a reason I seem to be unable 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?

        }
    }
}
HowDoIDoComputer
  • 1,383
  • 1
  • 10
  • 19

3 Answers3

33

You have to add Reference to the system.Drawing.Dll in your project.

Right click on Project, add reference and find System.Drawing.DLL and add reference.

EDIT: You will find it under Assemblies->Framework->System.Drawing

a2800276
  • 3,272
  • 22
  • 33
Moiz
  • 2,409
  • 5
  • 27
  • 50
5

Add System.Drawing.dll as reference assembly to your project.

Igor
  • 15,833
  • 1
  • 27
  • 32
-2

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