Skip to content

[iOS][Resizetizer] Wrong scale being used for PNG assets generated from SVG files #21291

@kazo0

Description

@kazo0

Current behavior 🐛

On iOS, using an Image or BitmapIcon inside of a Button is leading to blurry images when using the output PNG images from Resizetizer.

Sample app:
iconapp.zip

This code:

<StackPanel HorizontalAlignment="Center"
			VerticalAlignment="Center">
	<TextBlock Text="With Resizetizer:" />
	<Button BorderBrush="DarkGray"
			BorderThickness="1"
			CornerRadius="4"
			Style="{StaticResource IconButtonStyle}">
		<Button.Content>
			<Image Source="ms-appx:///Assets/Images/trash.png"
				   Stretch="None" />
		</Button.Content>
	</Button>
	<Button BorderBrush="DarkGray"
			BorderThickness="1"
			CornerRadius="4"
			Style="{StaticResource IconButtonStyle}">
		<Button.Content>
			<Viewbox Width="24"
					 Height="24">
				<BitmapIcon ShowAsMonochrome="False"
							UriSource="ms-appx:///Assets/Images/trash.png" />
			</Viewbox>
		</Button.Content>
	</Button>
	<TextBlock Text="With forced -scale.400:"
			   Margin="0,20,0,0" />
	<Button BorderBrush="DarkGray"
			BorderThickness="1"
			CornerRadius="4"
			Style="{StaticResource IconButtonStyle}">
		<Button.Content>
			<Image Height="24" Source="ms-appx:///Assets/Images/trash.scale-400.png"
				   Stretch="Uniform" />
		</Button.Content>
	</Button>
	<Button BorderBrush="DarkGray"
			BorderThickness="1"
			CornerRadius="4"
			Style="{StaticResource IconButtonStyle}">
		<Button.Content>
			<Viewbox Width="24"
					 Height="24">
				<BitmapIcon ShowAsMonochrome="False"
							UriSource="ms-appx:///Assets/Images/trash.scale-400.png" />
			</Viewbox>
		</Button.Content>
	</Button>
</StackPanel>

Leads to this:

Image Image

Renderer 🎨

  • Skia
  • Native

Affected platforms 📱💻🖥️

iOS

Uno.Sdk version (and other relevant versions) 📦

6.1.23

Metadata

Metadata

Assignees

Labels

difficulty/tbdCategorizes an issue for which the difficulty level needs to be defined.triage/untriagedIndicates an issue requires triaging or verification

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions