microsoft / microsoft/microsoft-ui-xaml

The image is not rendered properly when converting from Base64 to BitmapImage with Stretch set to None

Open
#10,642 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug needs-triage
Dominant language
C++
Stars
8.4k
Forks
942
Avg merge
2d 7h
Merged PRs (30d)
105

Description

### Describe the bug

I have an image inside a Border, where the Image.Source is updated using a BitmapImage created from a Base64 string. However, when Stretch is set to None, the image does not render properly.
I'm not sure whether this is an issue or expected native behavior — please take a look

**With Stretch None**

![Image](https://github.com/user-attachments/assets/3195f720-0c55-41e2-9314-3b2ce8affde6)

**With Strech Uniform**

![Image](https://github.com/user-attachments/assets/e34674cb-0594-4b5f-9843-fbbcc9edead2)

### Steps to reproduce the bug

Please deploy the sample

[WinUIAppTesting.zip](https://github.com/user-attachments/files/20978853/WinUIAppTesting.zip)

### Expected behavior

_No response_

### Screenshots

_No response_

### NuGet package version

None

### Windows version

Windows 10 (1809): Build 17763

### Additional context

_No response_

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by deploying the attached WinUIAppTesting.zip sample on the reported Windows 10 build and compare the image with Stretch set to None versus Uniform. Trace the BitmapImage created from the Base64 string and determine whether the behavior is a rendering bug or expected native behavior; completion requires a confirmed cause and an agreed expected result.

Written by the indexing model from the issue text.

Assessment

Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.