tags:

views:

27

answers:

2

Hi,

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?

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

Thoughts?

Cheers

Moo

A: 

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?

Padu Merloti
Yes, I don't want a reliance on silverlight at all if possible, as I'm developing a library for handling the image manipulation rather than a front end tool.
Moo
A: 

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.

Will