SmartK8
SmartK8

Reputation: 2626

How to get image from silverlight to non-silverlight?

I need a very weird thing I admit. I hope you'll be able to help me.

My current situation (all in one solution VS2010):

I somehow need to:

I've tried to reference the Silverlight assembly (from non-Silverlight assembly) with helper class returning the image. But that's just ugly.

Thanks, Kate

Note: The Silverlight control is a massive one, and used in three other projects (editor, viewer, windows phone 7 application) so I can't really move it. Also Silverlight's WPF-like drawing is far superior to non-Silverlight.

Upvotes: 0

Views: 611

Answers (1)

Ken Smith
Ken Smith

Reputation: 20445

There are lots of ways to do this, and I'm not entirely clear on what you're trying to accomplish, but something like this should work:

(1) The WriteableBitmap.Pixels property should contain an RGBA version of the image in question.

(2) Use FJCore to convert the RGBA bytes to JPEG format.

(3) Submit the JPEG file (contained in a byte[] array) via a call to the web service.

(4) On the web service, save the file in some appropriate location, where the other non-Silverlight applications can access it.

Would that do something like what you need?

Upvotes: 1

Related Questions