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?
}
}
}
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
Add System.Drawing.dll as reference assembly to your project.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With