Code Monkey home page Code Monkey logo

skiaimageview's Issues

It seems something wrong with Stretch and StretchDirection

似乎 缩放有问题
(It seems something wrong with Stretch and StretchDirection)
Snipaste_2024-03-01_15-37-09

Code
<Grid
	Background="GreenYellow"
	ColumnDefinitions="100,*,*,*"
	RowDefinitions="50,*,*,*,*">
	<Grid
		Grid.Row="0"
		Grid.Column="0"
		ColumnDefinitions="*,*">

		<Button
			Grid.Column="0"
			Height="30"
			Padding="5,5"
			HorizontalAlignment="Left"
			VerticalAlignment="Center"
			Command="{Binding Start}"
			Content="Start"
			Cursor="Hand"
			IsVisible="{Binding CancellationTokenSource, Converter={x:Static ObjectConverters.IsNull}}" />

		<Button
			Grid.Column="0"
			Height="30"
			Padding="5,5"
			HorizontalAlignment="Left"
			VerticalAlignment="Center"
			Command="{Binding Pause}"
			Content="Pause"
			Cursor="Hand"
			IsVisible="{Binding CancellationTokenSource, Converter={x:Static ObjectConverters.IsNotNull}}" />

		<Button
			Grid.Column="1"
			Height="30"
			Padding="5,5"
			HorizontalAlignment="Left"
			VerticalAlignment="Center"
			Command="{Binding Clean}"
			Content=" Clean"
			Cursor="Hand"
			IsVisible="{Binding Image, Converter={x:Static ObjectConverters.IsNotNull}}" />
	</Grid>
	<TextBlock
		Grid.Row="0"
		Grid.Column="1"
		HorizontalAlignment="Center"
		VerticalAlignment="Center"
		Text="Both" />
	<TextBlock
		Grid.Row="0"
		Grid.Column="2"
		HorizontalAlignment="Center"
		VerticalAlignment="Center"
		Text="UpOnly" />
	<TextBlock
		Grid.Row="0"
		Grid.Column="3"
		HorizontalAlignment="Center"
		VerticalAlignment="Center"
		Text="DownOnly" />

	<TextBlock
		Grid.Row="1"
		Grid.Column="0"
		HorizontalAlignment="Left"
		VerticalAlignment="Center"
		Text="None" />
	<TextBlock
		Grid.Row="2"
		Grid.Column="0"
		HorizontalAlignment="Left"
		VerticalAlignment="Center"
		Text="Fill" />
	<TextBlock
		Grid.Row="3"
		Grid.Column="0"
		HorizontalAlignment="Left"
		VerticalAlignment="Center"
		Text="Uniform" />
	<TextBlock
		Grid.Row="4"
		Grid.Column="0"
		HorizontalAlignment="Left"
		VerticalAlignment="Center"
		Text="UniformToFill" />

	<siv:SKImageView
		Grid.Row="1"
		Grid.Column="1"
		Source="{Binding Image}"
		Stretch="None"
		StretchDirection="Both" />

	<siv:SKImageView
		Grid.Row="1"
		Grid.Column="2"
		Source="{Binding Image}"
		Stretch="None"
		StretchDirection="UpOnly" />

	<siv:SKImageView
		Grid.Row="1"
		Grid.Column="3"
		Source="{Binding Image}"
		Stretch="None"
		StretchDirection="DownOnly" />

	<siv:SKImageView
		Grid.Row="2"
		Grid.Column="1"
		Source="{Binding Image}"
		Stretch="Fill"
		StretchDirection="Both" />

	<siv:SKImageView
		Grid.Row="2"
		Grid.Column="2"
		Source="{Binding Image}"
		Stretch="Fill"
		StretchDirection="UpOnly" />

	<siv:SKImageView
		Grid.Row="2"
		Grid.Column="3"
		Source="{Binding Image}"
		Stretch="Fill"
		StretchDirection="DownOnly" />

	<siv:SKImageView
		Grid.Row="3"
		Grid.Column="1"
		Source="{Binding Image}"
		Stretch="Uniform"
		StretchDirection="Both" />

	<siv:SKImageView
		Grid.Row="3"
		Grid.Column="2"
		Source="{Binding Image}"
		Stretch="Uniform"
		StretchDirection="UpOnly" />

	<siv:SKImageView
		Grid.Row="3"
		Grid.Column="3"
		Source="{Binding Image}"
		Stretch="Uniform"
		StretchDirection="DownOnly" />

	<siv:SKImageView
		Grid.Row="4"
		Grid.Column="1"
		Source="{Binding Image}"
		Stretch="UniformToFill"
		StretchDirection="Both" />

	<siv:SKImageView
		Grid.Row="4"
		Grid.Column="2"
		Source="{Binding Image}"
		Stretch="UniformToFill"
		StretchDirection="UpOnly" />

	<siv:SKImageView
		Grid.Row="4"
		Grid.Column="3"
		Source="{Binding Image}"
		Stretch="UniformToFill"
		StretchDirection="DownOnly" />
</Grid>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.