J'ai un problème avec un picturebox, je choisis un type d'image de GIF d'animation, l'image est affichée, mais il est bouge pas, par C# codeJ'ai un problème avec un picturebox avec animation GIF, il est bouge pas, par C# code
3
A
Répondre
0
Vous devez gérer l'animation manualy. voici un exemple http://www.vcskicks.com/csharp_animated_gif2.php
Modifier code est disponible ici: Can a PictureBox show animated GIF in Windows Application?
1
cela pourrait aider: ImageAnimator.Animate Method
using System;
using System.Drawing;
using System.Windows.Forms;
public class animateImage : Form
{
//Create a Bitmpap Object.
Bitmap animatedImage = new Bitmap("SampleAnimation.gif");
bool currentlyAnimating = false;
//This method begins the animation.
public void AnimateImage()
{
if (!currentlyAnimating)
{
//Begin the animation only once.
ImageAnimator.Animate(animatedImage, new EventHandler(this.OnFrameChanged));
currentlyAnimating = true;
}
}
private void OnFrameChanged(object o, EventArgs e)
{
//Force a call to the Paint event handler.
this.Invalidate();
}
protected override void OnPaint(PaintEventArgs e)
{
//Begin the animation.
AnimateImage();
//Get the next frame ready for rendering.
ImageAnimator.UpdateFrames();
//Draw the next frame in the animation.
e.Graphics.DrawImage(this.animatedImage, new Point(0, 0));
}
public static void Main()
{
Application.Run(new animateImage());
}
}
+0
GIF animé je animation prêt - je ne suis pas intéressé à faire manuel –
Questions connexes
- 1. Problèmes d'utilisation de QMovie avec animation GIF dans un QLabel
- 2. Problème avec le Picturebox en mouvement
- 3. créer une mosaïque avec jai
- 4. XNA GIF Animation Library problème
- 5. L'animation bouge avec un autre objet jquery
- 6. animation gif ne pas animer tout en rendant visible = true de PictureBox
- 7. "Une erreur générique s'est produite dans GDI +" après avoir chargé un PictureBox avec un GIF animé
- 8. Problème avec un certain code ...?
- 9. picturebox SizeMode.AutoSize problème C#
- 10. GIF animation Problème de consommation CPU en C#!
- 11. Problème avec gif animé sur Android
- 12. Animation - GIF
- 13. collision de caractères (picturebox) avec différents picturebox
- 14. Analyser une image avec JAI
- 15. Problème avec animation simple
- 16. Grande animation Gif
- 17. Python: Problème rare générant .gif avec ffmpeg
- 18. Chargement d'une PictureBox en C# avec un Blob Oracle
- 19. Problème wpf avec animation
- 20. Accéder aux cadres GIF avec C#
- 21. Problème avec Android Animation?
- 22. C# PictureBox ne pas afficher
- 23. Problème avec un code simple
- 24. Problème de transparence par PictureBox superposé à C#
- 25. Affichage Qt transparent animation gif
- 26. Y at-il un problème avec ce code foreach?
- 27. Y at-il un problème avec mon code vidéo?
- 28. Dim Image1 Comme PictureBox? Problème avec LoadPicture!
- 29. Problème avec jQuery Animation
- 30. quel est le problème avec ce code?
Auriez-vous de désactiver le contrôle PictureBox? Postez votre code aussi s'il vous plaît, cela devrait fonctionner en théorie. –
WinForms ne prend pas en charge de –