0

what i am trying to do is something like this on the mentioned event

    private void image1_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
    {
            //this.animateIC1.Begin();
        Uri uri = new Uri("Images/1.png", UriKind.Relative);
        ImageSource imgSource = new BitmapImage(uri);
        this.imageBack1.Source = imgSource;
        this.Storyboard1.Begin();
    }

it has an animation which flips the front image and loads the backside image.

so i am not able to achieve the desired output as it shows no image after flipping.

this is my "secret" StoryBoard which is behaving perfectly in ExpressionBlend environment.

    <Storyboard x:Name="Storyboard1">
        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationY)" Storyboard.TargetName="imageBack1">
            <EasingDoubleKeyFrame KeyTime="0:0:1" Value="90"/>
            <EasingDoubleKeyFrame KeyTime="0:0:2" Value="0"/>
        </DoubleAnimationUsingKeyFrames>
        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="imageBack1">
            <DiscreteObjectKeyFrame KeyTime="0:0:1">
                <DiscreteObjectKeyFrame.Value>
                    <Visibility>Visible</Visibility>
                </DiscreteObjectKeyFrame.Value>
            </DiscreteObjectKeyFrame>
        </ObjectAnimationUsingKeyFrames>
        <DoubleAnimation Duration="0:0:1" To="90" Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationY)" Storyboard.TargetName="image1" d:IsOptimized="True"/>
    </Storyboard>

2 Answers 2

1
private void Change_Background1(object sender, EventArgs e)
{
    Uri uri = new Uri("/img/day1.jpg", UriKind.Relative);
    ImageSource imgSource = new BitmapImage(uri);
    this.myImg.ImageSource = imgSource;
} 
Sign up to request clarification or add additional context in comments.

Comments

0

Without you showing your secret Storyboard, I would guess that you simply set the image source before your storyboard is started.

I'm guessing that you will need to do something along these lines and handle two image objects.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.