1

Been trying to display Gif's in my app but im having a pretty hard time getting things to work.

Seems like the fastest/best/only route is to use WebView. The only issue that I have with using WebView is I would need the Gifs to be stretched to fit the screen, without evidence(evidence, as in the White Background on web pages) that im loading the Gif from the web.

Anyways, is there some sort of magical way to display Gif's as described? Maybe some Javascript or HTML tricks we could do perhaps?

Gif for reference: https://i.stack.imgur.com/RGJOU.gif

(I did try using ImageTools which I could not get working on my app for some reason)

BluishMicrobe
  • 178
  • 1
  • 10

2 Answers2

1

you can't set the background of a WebView to transparent (AFAIK), and the Image element doesn't support animated GIFs so your best choice would probably be using the PictureBox control from WinForms which supports animated gifs and you can set the background to transparent of those.
an example can be found in this answer on how to do this

I also just found this project on GitHub (with nuget package) which adds a couple of DependencyProperties so you can just use a Image element, i haven't tried it yet though

Community
  • 1
  • 1
grabthefish
  • 962
  • 14
  • 30
1

FIXED!!

My Solution: WP8: Download and save GIF to isolated storage

Ended doing this, ` var ImageURL = "https://i.stack.imgur.com/J1Xfm.gif";

        string backgroundColor = "<body bgcolor=\"#000000\">"; // enter different hex value for different background color 

        string imageHTML = "<html><head><meta name=\"viewport\" " +
            "content=\"width=440\" id=\"viewport\" />" +
            "</head>" + backgroundColor + "<IMG SRC=\"" +
            ImageURL + "\"height=\"300\" width=\"300\"></body></html>";

        qwer.NavigateToString(imageHTML);`

Works Like a Champ! Now I can die in peace. :)

Community
  • 1
  • 1
BluishMicrobe
  • 178
  • 1
  • 10