首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >我在哪里可以找到System.Windows.Media?媒体不存在

我在哪里可以找到System.Windows.Media?媒体不存在
EN

Stack Overflow用户
提问于 2013-04-18 23:24:12
回答 3查看 4.8K关注 0票数 0

我试过了:

代码语言:javascript
复制
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using AviFile;
using ScreenShotDemo;
using System.Threading;
using System.Windows.

在我的新类中,但在底部的system.Windows中。没有媒体

我正在使用visual c# pro 2012和.net 4.5试图添加它作为参考在.net和COM中查找它,但它不在那里。

我需要它的原因是在我的代码中有PixelFormat,但它并不存在:

代码语言:javascript
复制
Bitmap bmpScreenShot = new Bitmap(currentScreen.Bounds.Width,
currentScreen.Bounds.Height,
PixelFormat.Format32bppArgb);

PixelFormat不存在。

EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2013-04-18 23:26:58

您需要将System.Drawing.Imaging添加到using语句中。

您通常可以通过右键单击有问题的项目并选择"Resolve“来轻松找到需要包含的内容

票数 5
EN

Stack Overflow用户

发布于 2014-11-23 11:38:00

我和我一样,花了几个小时试图找到using System.Windows.Media,但找不到BitmapImage,所以我写了这个答案。只需使用using Windows.UI.Xaml.Media.Imaging即可。它工作得很好。

票数 3
EN

Stack Overflow用户

发布于 2013-04-18 23:26:18

System.Windows.Media需要引用PresentationCore.dll和

Pixelformat需要引用System.Drawing.dll。

请参见reference here

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/16086966

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档