animations in WPF and special effects like blinds<p align=left><font face=Arial size=2></font> </p> <p>Hi,</p> <p align=left>In the past I created an effect horizontal blinds where parts of the screen where showing up line by line just like opening blinds in a house. That was easy because i used a bitmap..<img src="http://forums.microsoft.com/MSDN/WebResource.axd?d=NySzF1eivP_rMoc50GQJzcvS4MHMOEKwYrCIgDtzuzlw7GsNki3H_INlfYaLgkxFjZzlJqkjpAu4Xq-FyiiVVaQaw-vp9CJ___CKdW9Lf2I1&amp;t=633263991144971555"></p> <p align=left> </p> <p align=left>I converted my code to the WPF enviroment where all things are elements and no bitmaps. It looks good and smooth. No blinking during updates or transparency problems as with window forms...</p> <p align=left> </p> <p>Now I come to the point where I want to add animations to a WPF window. Moving from left to right or something is very easily with the leftproperty bound to the animation.</p> <p align=left> </p> <p align=left>But now comes the brainbracker...</p> <p align=left>How can i create an effect that will show an effect like a blind on the content of a canvas where the canvas itself contains elements like text, video etc...?</p> <p align=left>is there a way to apply a visible clip path on top of the canvas to show an effect.</p> <p align=left> </p> <p align=left>I know its friday and my brain starts converting to the weekend virtual machine part, but i would like to crack this problem before it is so far....</p> <p align=left> </p> <p align=left>Thanks for you ideas.</p>© 2009 Microsoft Corporation. All rights reserved.Thu, 19 Jun 2008 00:15:52 Z6d9cd83f-2257-445a-a840-4c1045aa879fhttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/6d9cd83f-2257-445a-a840-4c1045aa879f#6d9cd83f-2257-445a-a840-4c1045aa879fhttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/6d9cd83f-2257-445a-a840-4c1045aa879f#6d9cd83f-2257-445a-a840-4c1045aa879fWillie007http://social.msdn.microsoft.com/Profile/en-US/?user=Willie007animations in WPF and special effects like blinds<p align=left><font face=Arial size=2></font> </p> <p>Hi,</p> <p align=left>In the past I created an effect horizontal blinds where parts of the screen where showing up line by line just like opening blinds in a house. That was easy because i used a bitmap..<img src="http://forums.microsoft.com/MSDN/WebResource.axd?d=NySzF1eivP_rMoc50GQJzcvS4MHMOEKwYrCIgDtzuzlw7GsNki3H_INlfYaLgkxFjZzlJqkjpAu4Xq-FyiiVVaQaw-vp9CJ___CKdW9Lf2I1&amp;t=633263991144971555"></p> <p align=left> </p> <p align=left>I converted my code to the WPF enviroment where all things are elements and no bitmaps. It looks good and smooth. No blinking during updates or transparency problems as with window forms...</p> <p align=left> </p> <p>Now I come to the point where I want to add animations to a WPF window. Moving from left to right or something is very easily with the leftproperty bound to the animation.</p> <p align=left> </p> <p align=left>But now comes the brainbracker...</p> <p align=left>How can i create an effect that will show an effect like a blind on the content of a canvas where the canvas itself contains elements like text, video etc...?</p> <p align=left>is there a way to apply a visible clip path on top of the canvas to show an effect.</p> <p align=left> </p> <p align=left>I know its friday and my brain starts converting to the weekend virtual machine part, but i would like to crack this problem before it is so far....</p> <p align=left> </p> <p align=left>Thanks for you ideas.</p>Fri, 26 Oct 2007 08:47:34 Z2007-10-30T10:29:41Zhttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/6d9cd83f-2257-445a-a840-4c1045aa879f#f2fb6c41-88c0-4c48-a260-507cf63e53b8http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/6d9cd83f-2257-445a-a840-4c1045aa879f#f2fb6c41-88c0-4c48-a260-507cf63e53b8Jeremiah Morrillhttp://social.msdn.microsoft.com/Profile/en-US/?user=Jeremiah%20Morrillanimations in WPF and special effects like blindsIf you are talking about transition type effects, like horizontal blinds, fades and wipes, check out Kevin's bag o tricks - Mix edition <a title="http://wpf.netfx3.com/files/folders/controls/entry10297.aspx" href="http://wpf.netfx3.com/files/folders/controls/entry10297.aspx">http://wpf.netfx3.com/files/folders/controls/entry10297.aspx</a> <p align=left><font face=Arial size=2></font> </p> <p align=left>The transition presenter in there has those and a million more.</p>Fri, 26 Oct 2007 11:15:07 Z2007-10-26T11:15:07Zhttp://social.msdn.microsoft.com/Forums/en-US/wpf/thread/6d9cd83f-2257-445a-a840-4c1045aa879f#5611e527-9bcf-4932-8294-fda461ccf5c2http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/6d9cd83f-2257-445a-a840-4c1045aa879f#5611e527-9bcf-4932-8294-fda461ccf5c2Willie007http://social.msdn.microsoft.com/Profile/en-US/?user=Willie007animations in WPF and special effects like blinds<p align=left><font face=Arial size=2>This is how i got my vertical split function to work.</font> <p align=left>I connect it to the clip of a canvas that must become visible. <p align=left><font face=Arial size=2>  <div class=codeseg> <div class=codecontent> <div class=codesniptitle><span style="width:100%">Code Block</span></div> <p align=left>Dim Page as Canvas</p> <p align=left> </p> <p align=left> </p> <p align=left>private Sub VerticalSplitEffect</p><font size=2> <p align=left></font><font color="#0000ff" size=2>Dim</font><font size=2> c </font><font color="#0000ff" size=2>As</font><font size=2> </font><font color="#0000ff" size=2>Double</font><font size=2> = 25</p> <p align=left></font><font color="#0000ff" size=2>Dim</font><font size=2> x </font><font color="#0000ff" size=2>As</font><font size=2> </font><font color="#0000ff" size=2>Double</font><font size=2> = Page.Width</p> <p align=left></font><font color="#0000ff" size=2>Dim</font><font size=2> y </font><font color="#0000ff" size=2>As</font><font size=2> </font><font color="#0000ff" size=2>Double</font><font size=2> = Page.Height</p> <p align=left></font><font color="#0000ff" size=2>Dim</font><font size=2> Cnt </font><font color="#0000ff" size=2>As</font><font size=2> </font><font color="#0000ff" size=2>Double</font><font size=2> = Math.Ceiling(x / c)</p> <p align=left></font><font color="#0000ff" size=2>Dim</font><font size=2> G </font><font color="#0000ff" size=2>As</font><font size=2> </font><font color="#0000ff" size=2>New</font><font size=2> GeometryGroup</p> <p align=left></font><font color="#0000ff" size=2>Dim</font><font size=2> ID </font><font color="#0000ff" size=2>As</font><font size=2> </font><font color="#0000ff" size=2>String</p></font><font size=2> <p align=left></font><font color="#0000ff" size=2>Dim</font><font size=2> AnimClipRegion </font><font color="#0000ff" size=2>As</font><font size=2> Geometry = </font><font color="#0000ff" size=2>Nothing</p></font><font size=2> <p align=left></font><font color="#0000ff" size=2>For</font><font size=2> i </font><font color="#0000ff" size=2>As</font><font size=2> </font><font color="#0000ff" size=2>Double</font><font size=2> = 0 </font><font color="#0000ff" size=2>To</font><font size=2> Cnt - 1</p> <p align=left> AnimClipRegion = </font><font color="#0000ff" size=2>New</font><font size=2> RectangleGeometry(</font><font color="#0000ff" size=2>New</font><font size=2> Rect(0, 0, 0, 0), 0, 0) </font><font color="#008000" size=2>'create new one</p></font><font size=2> <p align=left> ID = CreateNewID() </p> <p align=left> Page.RegisterName(ID, AnimClipRegion)</p> <p align=left> G.Children.Add(AnimClipRegion)</p> <p align=left></font><font color="#0000ff" size=2> Dim</font><font size=2> AnimationRect </font><font color="#0000ff" size=2>As</font><font size=2> </font><font color="#0000ff" size=2>New</font><font size=2> Animation.RectAnimation(</font><font color="#0000ff" size=2>New</font><font size=2> Rect(i * c, 0, 0, y), </font><font color="#0000ff" size=2>New</font><font size=2> Rect(i * c, 0, c, y), </font><font color="#0000ff" size=2>New</font><font size=2> Duration(TimeSpan.FromMilliseconds(Duration)), Animation.FillBehavior.Stop)</p> <p align=left> Windows.Media.Animation.Storyboard.SetTargetName(AnimationRect, ID)</p> <p align=left> Windows.Media.Animation.Storyboard.SetTargetProperty(AnimationRect, </font><font color="#0000ff" size=2>New</font><font size=2> PropertyPath (RectangleGeometry.RectProperty))</p> <p align=left> StoryBoardAnimator.Children.Add(AnimationRect)</p> <p align=left></font><font color="#0000ff" size=2>Next</p></font><font size=2> <p align=left>Page.Clip = G</p></font> <p align=left>End Sub</p> <p align=left> </p> <p align=left> </p><font size=2> <p></font><font color="#0000ff" size=2>Private</font><font size=2> </font><font color="#0000ff" size=2>Function</font><font size=2> CreateNewID() </font><font color="#0000ff" size=2>As</font><font size=2> </font><font color="#0000ff" size=2>String</p></font><font size=2> <p></font><font color="#0000ff" size=2>On</font><font size=2> </font><font color="#0000ff" size=2>Error</font><font size=2> </font><font color="#0000ff" size=2>Resume</font><font size=2> </font><font color="#0000ff" size=2>Next</p></font><font size=2> <p></font><font color="#0000ff" size=2>Return</font><font size=2> </font><font size=2>Guid.NewGuid.ToString(</font><font color="#a31515" size=2>&quot;N&quot;</font><font size=2>)</p> <p></font><font color="#0000ff" size=2>End</font><font size=2> </font><font color="#0000ff" size=2>Function</p></font></div></div> <p align=left> </p></font> <p></p><font size=2> <p align=left></p></font>Tue, 30 Oct 2007 10:29:00 Z2007-10-30T10:29:41Z