Using WPF controls in a background or ASP.Net environment

后端 未结 2 395
青春惊慌失措
青春惊慌失措 2021-01-21 19:16

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 so

相关标签:
2条回答
  • 2021-01-21 19:56

    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).

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

    0 讨论(0)
  • 2021-01-21 20:00

    Take a look at RenderTargetBitmap. You could do whatever with your WPF component, then render it as a bitmap, and then use that bitmap on your ASP page.

    I'm not sure that is the best way of doing it though. Is Silverlight out of question for you?

    0 讨论(0)
提交回复
热议问题