ASP.NET应用程序中是否支持System.Windows.Media.Imaging类? [英] Are System.Windows.Media.Imaging Classes Supported in ASP.NET Applications?

查看:54
本文介绍了ASP.NET应用程序中是否支持System.Windows.Media.Imaging类?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

System.Windows.Media.Imaging中的类是否支持在ASP.NET应用程序中使用,或者这些类是否具有与System.Drawing类类似的内存/死锁/不受支持的问题?方案

Jared S. _,

谢谢您在这里发布.

对于您的问题,请添加"Presentation.dll"在您的asp.net项目中.

该dll位于c:\ Program Files \ Reference Assemblies \ Microsoft \ Framework \ v3.0 \ PresentationCore.dll中.


这是中的简单代码 MSDN 文章供您参考.

 FileStream流=新的FileStream("empty.tif",FileMode.Create);
TiffBitmapEncoder编码器=新的TiffBitmapEncoder();
TextBlock myTextBlock =新的TextBlock();
myTextBlock.Text =编解码器作者是:" + encoder.CodecInfo.Author.ToString();
encoder.Frames.Add(BitmapFrame.Create(image));
MessageBox.Show(myPalette.Colors.Count.ToString());
encoder.Save(stream);

我希望这会有所帮助.

最好的问候,

温迪


Are the classes in System.Windows.Media.Imaging supported for use in ASP.NET applications or do these classes have similar memory/deadlock/unsupported issues as the System.Drawing classes?

解决方案

Hi Jared S. _,

Thank you for posting here.

For your question, please add the "Presentation.dll" in your asp.net project.

The dll is in c:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0\PresentationCore.dll.


Here is a simple code in MSDN article for your reference.

FileStream stream = new FileStream("empty.tif", FileMode.Create);
TiffBitmapEncoder encoder = new TiffBitmapEncoder();
TextBlock myTextBlock = new TextBlock();
myTextBlock.Text = "Codec Author is: " + encoder.CodecInfo.Author.ToString();
encoder.Frames.Add(BitmapFrame.Create(image));
MessageBox.Show(myPalette.Colors.Count.ToString());
encoder.Save(stream);

I hope this would be helpful.

Best Regards,

Wendy


这篇关于ASP.NET应用程序中是否支持System.Windows.Media.Imaging类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆