Host WPF animation in Windows form -
project in visual studio 2010, can upgrade 2012 if need be. want animate logo splash screen. can using wpf. can host wpf animation in windows form in vb.net visual studio project?
in blend create new project , usercontrol in project. added logo images, animated , saved. can bring blend project visual studio solution , referenced it, added images resources. created panel on form , in code created new elementhost , set usercontrol xaml file child in splash screen load event. windows form shows, images don’t , of course no animation. can done? if so, guidance appreciated.
code:
imports system.windows.forms.integration public class wpfsplash public splashelementhost new elementhost public logo new wpfcontrollibrary1.applicationlogo.ctllogo private sub wpfsplash_load(sender object, e system.eventargs) handles me.load splashelementhost.child = logo splashelementhost.location = new point(13, 13) splashelementhost.size = new size(723, 644) pnlelementhost.controls.add(splashelementhost) end sub end class
if you're hosting wpf application inside winforms element host you'll limited winforms rendering engine, no, can't done.
keep in mind animations being rendered wpf have rendered again winforms afterwards, , can't handle animations. found out hard way, unfortunately.
Comments
Post a Comment