繁体   English   中英

在控制台应用程序中创建图像或位图 - 似乎无法找到System.Drawing?

[英]Create Image or Bitmap in console application - can't seem to find System.Drawing?

我正在尝试从相机比特流创建一个图像或位图,我将(希望)通过websocket传递给浏览器。 我正在构建的应用程序是一个控制台应用程序,因为我认为这个应用程序不需要有GUI。 现在我在创建/访问Image和Bitmap类时遇到了麻烦 - System.Drawing似乎不存在,我不知道为什么。 当我尝试using System.Drawing我得到错误The type or namespace name 'Drawing' does not exist in the namespace 'System' (are you missing an assembly reference?)在控制台应用程序中创建位图的最佳方法是什么The type or namespace name 'Drawing' does not exist in the namespace 'System' (are you missing an assembly reference?)有没有理由我似乎无法加载System.Drawing?

码:

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?

        }
    }
}

您必须在项目中添加对system.Drawing.Dll的引用。

右键单击Project,添加引用并查找System.Drawing.DLL并添加引用。

编辑:您将在Assemblies-> Framework-> System.Drawing下找到它

将System.Drawing.dll作为引用程序集添加到项目中。

包括System.Drawing.dll参考1)你可以从http://www.dllme.com/dll/download/7139/System.Drawing.dll下载它

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM