在后台或ASP.Net环境中使用WPF控件 [英] Using WPF controls in a background or ASP.Net environment

查看:101
本文介绍了在后台或ASP.Net环境中使用WPF控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到某些WPF控件具有一些不错的效果(阴影,反射等),并且想知道是否有可能仅将这些WPF控件用于其可用效果吗?

I have noticed that some WPF controls have some decent effects available to them (drop shadow, reflection etc), and was wondering if it was possible to use these WPF controls solely for their available effects?

例如,我有一个图像处理库,该库可以调整大小和不同大小的图像的信箱大小,但我想向生成的图像添加阴影效果.WPF图像控件具有此效果,但是在永远没有GUI(例如控制台应用程序或ASP.Net库/处理程序)的环境中使用它很容易.

For example, I have an image manipulation library that resizes and letterboxes disparate sized images but I would like to add drop shadow effects to the resulting images. The WPF image control has this effect available, but how easy is it to use in an environment where there will never be a GUI (console app or ASP.Net library/handler for example).

有想法吗?

欢呼

Moo

推荐答案

可以使用它们,可以.唯一的问题是,您必须在STA线程中使用它们,您可能无法指望它们会自动发生(例如,ASP.NET中的响应线程是MTA).

You can use them, yes. The only problem is that you have to use them within STA threads, which you probably can't count on happening automagically (e.g., response threads in ASP.NET are MTA).

我在Windows Service应用程序中使用WPF控件.在执行渲染之前,我只需要过渡到STA线程即可.

I'm using WPF controls in a windows service app. I just have to transition to an STA thread before I do my rendering.

这篇关于在后台或ASP.Net环境中使用WPF控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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