Sergio Tapia
Sergio Tapia

Reputation: 41138

How can I play a .swf file on my WPF application?

I want to display a simple .SWF file on my WPF Form. It's a simple animation on loop.

Is there a control "box" type element I can place on my form and just load the .swf file to it so it can play?

Thank you for the help. :D

Upvotes: 0

Views: 7352

Answers (4)

mico
mico

Reputation: 1916

You might use a script, as in this page, to load an animation

<html>
<head>
<script type="text/javascript">
window.location.href = 'my_animation.swf';
</script>
</head>
<body>
</body>

you have the choice to create the page dinamically, create the script dynamically or host the page in a control and use its automation.

Upvotes: 1

Alex
Alex

Reputation: 150

A solution for a similar question can be found here: how to play flash in WPF application

In summary, you can use AXShockwaveFlash. Instructions found: http://www.pooredesign.com/blog/?p=d9165e80-d075-4faf-8a10-bfaf17769198

Also: although the description uses YouTube as an example this should work with local files as well.

Upvotes: 1

Matthias
Matthias

Reputation: 12259

Well - can you convert this animation into XAML? That would be the best.

WPF and Flash are not really compatible to each other :-)

It could work using the WebBrowser class - there's no elegant way I know, however.

Upvotes: 0

Joseph
Joseph

Reputation: 25513

You basically have to host it inside an html page and then reference the swf through the html page. On the WPF side you'll put a Frame xaml tag in your app that will refer to the html page.

Here's a link about how to do it.

Upvotes: 3

Related Questions