Comments (11)
Hi @ondrejsvorc,
Sorry you're having trouble. Not sure what could be causing this... it should work fine.
Is the ImageBehavior.AutoStart
property set to true?
from wpfanimatedgif.
I tried using the other library of yours, XamlAnimatedGif,
AnimationBehavior.SetSourceUri(turtle.Body, gifSourceTurtle);
but it unfortunately didn't work either.
XamlAnimatedGif takes a URI, not a BitmapSource.
from wpfanimatedgif.
Hi @ondrejsvorc,
Sorry you're having trouble. Not sure what could be causing this... it should work fine.
Is the
ImageBehavior.AutoStart
property set to true?
Well, I tried the following: ImageBehavior.SetAutoStart(turtle.Body, true);
and it didn't make it work.
from wpfanimatedgif.
I tried using the other library of yours, XamlAnimatedGif,
AnimationBehavior.SetSourceUri(turtle.Body, gifSourceTurtle);
but it unfortunately didn't work either.XamlAnimatedGif takes a URI, not a BitmapSource.
Yeah, thanks. I mistyped there. However, it doesn't make a difference. The problem still lasts.
from wpfanimatedgif.
Well, I tried the following: ImageBehavior.SetAutoStart(turtle.Body, true); and it didn't make it work.
It's set to true by default, but I wonder if maybe you had disabled it
Anyway, in order to help you, I'm going to need to see more of your code. Are you able to share your project? If not, could you try to create a simple repro that you could share?
from wpfanimatedgif.
Well, I tried the following: ImageBehavior.SetAutoStart(turtle.Body, true); and it didn't make it work.
It's set to true by default, but I wonder if maybe you had disabled it
Anyway, in order to help you, I'm going to need to see more of your code. Are you able to share your project? If not, could you try to create a simple repro that you could share?
Sure. There you have it all https://github.com/ondrejsvorc/TurtleWalk
from wpfanimatedgif.
Hi @ondrejsvorc,
Thanks for the repro! But I'm not sure what I'm supposed to do to reproduce the problem. It seems the only thing I can do is launch level 1, where I see the turtle cross the screen but I can't do anything. The UpdateImages method is never executed.
How should I reproduce the problem?
from wpfanimatedgif.
You have to click on the images in the top right corner. One of them changes direction of the turtle and the other one stops or starts her movement. Once you do so, one of their Click methods is executed - at the end of the method there is UpdateImages() being called. I hope it helps!
from wpfanimatedgif.
Strange... on the PC where I first tried it, the control buttons didn't show up. Neither did the language switch buttons, so the app was in Czech. I just tried on another PC, and now I see those buttons.
I was able to reproduce the issue, however I don't really understand what's going on... The problem is related to the fact that you're using relative URIs for your images. This causes the animation loading to be deferred, and it should be retried when the base URI is known, but for some reason, that doesn't happen.
So, I don't know the exact cause, but there's an easy fix: use absolute URIs.
i.e. instead of
./Resources/Images/Turtle/turtle_direction_forward.gif
use
pack://application:,,,/Resources/Images/Turtle/turtle_direction_forward.gif
(and remove UriKind.Relative when you create the Uri instances)
from wpfanimatedgif.
Hello,
I've been thinking a bit and I came to realise I use margins in XAML to position its content. Hence everyone sees my game wrongly on smaller monitors. I'm aware it is a bad practise and I will replace it, probably by Grid.RowDefinitions and Grid.ColumnDefinitions.
Thanks a lot for solving the problem. I really do appreciate your time! If it weren't for you, I would be probably still sitting here, racking my brain over it.
Have a nice rest of your day!
from wpfanimatedgif.
You're welcome. Good luck with your project!
from wpfanimatedgif.
Related Issues (20)
- Set from code HOT 2
- Huge memory consumption HOT 1
- Application freezes when resizing the window HOT 1
- Memory Leak HOT 3
- Version is 0.0.0.0 HOT 6
- Crash application when reading specific gif HOT 1
- error HOT 1
- Memory Release Problem (2) HOT 11
- An XDG0062 error is thrown HOT 4
- Is there a way to free the BitmapImage ressources? HOT 2
- Some gif pics cannot display correctly. HOT 3
- Does not display a specific gif file HOT 3
- Not working with DrawingImage HOT 5
- File version lowered to 1.0.0 HOT 4
- Cache gif in memory so it plays instantly when shown HOT 7
- Delay animation for any gif? HOT 4
- Memory Leak HOT 3
- Pause and play with XAML HOT 1
- System.Windows.Markup.XamlParseException: Could not load 'file or assembly 'WpfAnimatedGif HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wpfanimatedgif.