# Tip: Displaying Animated Gifs

**URL:** <https://forum.xojo.com/t/tip-displaying-animated-gifs/81235>\
**Category:** Getting Started\
**Created:** [August 2, 2024, 11:26am UTC](https://forum.xojo.com/t/tip-displaying-animated-gifs/81235 "2024-08-02T11:26:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stephen\_Dodd](https://forum.xojo.com/user_avatar/forum.xojo.com/stephen_dodd/32/530_2.png) [@Stephen\_Dodd](https://forum.xojo.com/u/Stephen_Dodd)\
**Post date:** [August 2, 2024, 11:26am UTC](https://forum.xojo.com/t/tip-displaying-animated-gifs/81235/1 "2024-08-02T11:26:19Z")

</div>

- Use DesktopHTMLViewer
- Create a separate HTML file. Mine is ![]()
- Right click on your desktop target in the IDE. Add a Copy Files script. Drag in both your HTML file and your gif. Set the destination to Resources.
- Run this code in the DesktopHTMLViewer Opening event

```auto
Var file As FolderItem = SpecialFolder.Resource("mac_icon.html")

If Not file.Exists Then
  MessageBox "HTML not found"
  Return
End If

Me.LoadPage(file)

```

NOTES  
(After spending longer than this should have taken…)

- Loading the gif file path directly into DesktopHTMLViewer.LoadURL doesn’t appear to work
- Creating the same HTML in code and using Me.LoadPage(htmlContent, resourceFolder) doesn’t seem to work on Windows. The HTML works but it doesn’t locate the gif correctly. Works fine on Mac.
- Others have suggested loading and displaying each frame of the gif

Tested Xojo 2024 r2.1 on an Intel Mac and Windows 10 in Parallels

---

<div class="post-metadata">

**Author:** ![Sascha\_S](https://forum.xojo.com/user_avatar/forum.xojo.com/sascha_s/32/22328_2.png) [@Sascha\_S](https://forum.xojo.com/u/Sascha_S)\
**Post date:** [August 2, 2024, 11:35am UTC](https://forum.xojo.com/t/tip-displaying-animated-gifs/81235/2 "2024-08-02T11:35:01Z")

</div>

> [@Stephen\_Dodd](#):
>
> Others have suggested loading and displaying each frame of the gif

i assume because, if you

> [@Stephen\_Dodd](#):
>
> Use DesktopHTMLViewer

you can at the same time watch your App’s Size grow by 100+MB ? 🙂

Nevertheless, thank you for the tip. 👍 ☺

---

<div class="post-metadata">

**Author:** ![Stephen\_Dodd](https://forum.xojo.com/user_avatar/forum.xojo.com/stephen_dodd/32/530_2.png) [@Stephen\_Dodd](https://forum.xojo.com/u/Stephen_Dodd)\
**Post date:** [August 7, 2024, 11:16am UTC](https://forum.xojo.com/t/tip-displaying-animated-gifs/81235/3 "2024-08-07T11:16:07Z")

</div>

> [@Sascha\_S](#):
>
> watch your App’s Size grow by 100+MB

Oh, I didn’t know!

---

<div class="post-metadata">

**Author:** ![Stephen\_Dodd](https://forum.xojo.com/user_avatar/forum.xojo.com/stephen_dodd/32/530_2.png) [@Stephen\_Dodd](https://forum.xojo.com/u/Stephen_Dodd)\
**Post date:** [August 7, 2024, 11:16am UTC](https://forum.xojo.com/t/tip-displaying-animated-gifs/81235/4 "2024-08-07T11:16:59Z")

</div>

The other way to do this is to load an external web page by URL. This seems to work consistently.
