상세 컨텐츠

본문 제목

wpf 에 swf 파일 올리기

WPF

by happynuri 2008. 2. 15. 11:07

본문


로컬에 존재하는 swf 파일을 wpf에 올리고 싶은 경우
                WebBrowser wb = new WebBrowser();
                wb.Url = new Uri(@"swf 파일 경로",UriKind.RelativeOrAbsolute);
                WindowsFormsHost host = new WindowsFormsHost();
                host.Child = wb;

                Grid grid = new Grid();
                grid.Children.Add(host);

                Content = grid;


웹에 있는 swf 를 올리고 싶을 때는

                WebBrowser wb = new WebBrowser();
                wb.documentText = "<embed src='" + "웹에 있는 swf의 주소" + "'/>";
                WindowsFormsHost host = new WindowsFormsHost();
                host.Child = wb;

                Grid grid = new Grid();
                grid.Children.Add(host);

                Content = grid;


물론.. 참조에

using System.Windows.Forms;
using System.Windows.Forms.Integration;
잊지 말기

xaml에는
xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
이렇게 참조해서 사용하기


아래분 꺼 보고 약간 수정 했어요
http://blog.naver.com/inasie?Redirect=Log&logNo=70013551006 

관련글 더보기

댓글 영역