Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
A Zoom Effect - Need some graphics advice
Message
From
25/03/2009 13:18:31
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01391293
Message ID:
01391443
Views:
93
>I should probably start by saying that the application that I'm working on breaks all kinds of windows interface guidelines, purposely <g>.
>That said, I'm considering an effect that would cause a button to "zoom" much larger than it's original size when a bound event fires - a special visual notification. I'm looking for a kind of cartooney effect (Think Jim Carrey's The Mask). The trick is the main application window can be quite skinny and I want this effect to be able to expand right out of its contained window.
>
>The only way that comes to mind right off is to create a class based, top level form that would have a transparent edges and is shaped approximately like the button, make this visible during the effect and thenr esize it on a timer. I'm not sure if that method will render fast enough to look convincing or not.
>
>Before I start down that road, has anyone done anything like this before? Or maybe one of the GDI graphic gurus could offer a better way of tackling this?
>
>Thanks,
>
>-m@

Also check XAML host in Craig Boyd's blog. With XAML it is declarative animation and you could do it very simply few lines of code. Here is a xaml sample (save to a file with .xaml extension and dragdrop to a browser or replace "Page" with "UserControl" and try with Craig;s VFPXAML control).
<Page 
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
   <Grid>
      <Button
         Width="150"
         Height="50"
         BorderBrush="Green"
         BorderThickness="3"> 
        Click The Mask
         <Button.RenderTransform>
            <TransformGroup>
               <ScaleTransform
                  x:Name="MyAnimatedScaleTransform"
                  CenterX="75"
                  CenterY="25"
                  ScaleX="1"
                  ScaleY="1"/>
               <SkewTransform x:Name="MyAnimatedSkewTransform" AngleX="0" AngleY="0" CenterX="75" CenterY="25"/>
               <RotateTransform x:Name="MyAnimatedTransform" Angle="0" CenterX="75" CenterY="25"/>
               <TranslateTransform x:Name="MyTranslateTransform" X="0" Y="0"/>
            </TransformGroup>
         </Button.RenderTransform>
         <Button.Background>
            <SolidColorBrush x:Name="myAnimatedBrush" Color="LightGreen"/>
         </Button.Background>
         <Button.Triggers>
            <EventTrigger RoutedEvent="Button.Click">
               <BeginStoryboard>
                  <Storyboard>
                     <DoubleAnimation
                        AccelerationRatio="0.4"
                        AutoReverse="True"
                        BeginTime="0:0:0"
                        Duration="0:0:0.6"
                        RepeatBehavior="1x"
                        Storyboard.TargetName="MyAnimatedScaleTransform"
                        Storyboard.TargetProperty="(ScaleTransform.ScaleX)"
                        To="20.0"/>
                     <DoubleAnimation
                        AccelerationRatio="0.8"
                        AutoReverse="True"
                        BeginTime="0:0:0"
                        Duration="0:0:0.4"
                        RepeatBehavior="1x"
                        Storyboard.TargetName="MyAnimatedScaleTransform"
                        Storyboard.TargetProperty="(ScaleTransform.ScaleY)"
                        To="20.0"/>
                     <DoubleAnimation
                        AutoReverse="True"
                        BeginTime="0:0:1"
                        Duration="0:0:1"
                        RepeatBehavior="1x"
                        Storyboard.TargetName="MyAnimatedScaleTransform"
                        Storyboard.TargetProperty="(ScaleTransform.ScaleX)"
                        To="-20.0"/>
                     <DoubleAnimation
                        AutoReverse="True"
                        BeginTime="0:0:1"
                        Duration="0:0:1"
                        RepeatBehavior="1x"
                        Storyboard.TargetName="MyAnimatedScaleTransform"
                        Storyboard.TargetProperty="(ScaleTransform.ScaleY)"
                        To="-20.0"/>
                     <ColorAnimation
                        BeginTime="0:0:0"
                        Duration="0:0:1"
                        From="LightGreen"
                        Storyboard.TargetName="myAnimatedBrush"
                        Storyboard.TargetProperty="Color"
                        To="Blue"/>
                     <ColorAnimation
                        BeginTime="0:0:1.1"
                        Duration="0:0:2"
                        From="Blue"
                        Storyboard.TargetName="myAnimatedBrush"
                        Storyboard.TargetProperty="Color"
                        To="Red"/>
                     <ColorAnimation
                        BeginTime="0:0:3"
                        Duration="0:0:2"
                        From="Red"
                        Storyboard.TargetName="myAnimatedBrush"
                        Storyboard.TargetProperty="Color"
                        To="LightGreen"/>
                     <DoubleAnimation
                        BeginTime="0:0:3"
                        Duration="0:0:2"
                        From="0.0"
                        Storyboard.TargetName="MyAnimatedTransform"
                        Storyboard.TargetProperty="(RotateTransform.Angle)"
                        To="360"/>
                     <DoubleAnimation
                        BeginTime="0:0:3"
                        Duration="0:0:2"
                        From="0.0"
                        RepeatBehavior="1x"
                        Storyboard.TargetName="MyAnimatedSkewTransform"
                        Storyboard.TargetProperty="(SkewTransform.AngleX)"
                        To="360"/>
                     <DoubleAnimation
                        BeginTime="0:0:3"
                        Duration="0:0:2"
                        From="0.0"
                        RepeatBehavior="1x"
                        Storyboard.TargetName="MyAnimatedSkewTransform"
                        Storyboard.TargetProperty="(SkewTransform.AngleY)"
                        To="360"/>
                  </Storyboard>
               </BeginStoryboard>
            </EventTrigger>
         </Button.Triggers>
      </Button>
   </Grid>
</Page>
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform