Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Animated GIF problem in WPF

Tags:

c#

.net-3.5

wpf

I have added above code in my WPF from which include animated GIF image, the problem is whenever form load I don't find any of the Image displayed on form, any suggestions ???

<Image Name="imgScan"  Source="Images\Pre_Scan_RealImage.gif" />

I even tried Image element shown above

like image 532
Prashant Cholachagudda Avatar asked Sep 20 '25 13:09

Prashant Cholachagudda


2 Answers

Use XAML below

<MediaElement Height="30" Width="30" LoadedBehavior="Play" Source="Images\loading.gif" />

Set properties of loading.gif

  1. BuildAction : None
  2. Copy to Output Directory : Copy always

It should work.

like image 101
Somnath Avatar answered Sep 22 '25 07:09

Somnath


WPF at the moment doesn't natively support animated GIFs.

You can get around it by hosting the image in a PictureBox.

EDIT : Also checkout this thread for a bit more info.

like image 38
PaulB Avatar answered Sep 22 '25 05:09

PaulB