Skip to content

Add animated GIF sample to Image page#2178

Merged
marcelwgn merged 3 commits into
microsoft:mainfrom
niels9001:add-animated-gif-sample
May 23, 2026
Merged

Add animated GIF sample to Image page#2178
marcelwgn merged 3 commits into
microsoft:mainfrom
niels9001:add-animated-gif-sample

Conversation

@niels9001
Copy link
Copy Markdown
Collaborator

Adds a new ControlExample to the Image samples page demonstrating BitmapImage animated GIF support, based on the UWP XamlAnimatedGif reference sample.

Scenarios covered

  • Default behavior: an animated GIF assigned to Image.Source plays automatically.
  • BitmapImage.AutoPlay=False to keep the GIF on its first frame.
  • Manual playback via BitmapImage.Play() / Stop() buttons, shown only when IsAnimatedBitmap is true (queried after ImageOpened).

Changes

  • WinUIGallery/Samples/Image/ImagePage.xaml - new ControlExample.
  • WinUIGallery/Samples/Image/ImagePage.xaml.cs - ClickToPlaySource_ImageOpened handler.
  • WinUIGallery/Samples/Image/AnimatedGif.txt - displayed XAML/C# snippet.
  • WinUIGallery/Assets/SampleMedia/animated.gif - sample asset (from the UWP XamlAnimatedGif sample, MIT-licensed).

Builds clean on x64 Debug.

niels9001 and others added 3 commits May 22, 2026 16:50
Demonstrates BitmapImage animated GIF support: default auto-play, AutoPlay=False, and manual Play()/Stop() control gated on IsAnimatedBitmap via ImageOpened. Adds animated.gif asset to SampleMedia.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…e panel

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@marcelwgn marcelwgn enabled auto-merge (squash) May 23, 2026 12:02
@marcelwgn
Copy link
Copy Markdown
Contributor

/azp run

@marcelwgn marcelwgn merged commit 4907f68 into microsoft:main May 23, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants