WPFの画像が見切れる
Q&A
Closed
画像が見切れるのを何とかしたい
WPFでアプリを作っていたのですが、なんか写真が見切れてしまって。
また、ボタンを配置しても見切れる時があるんですよ。
調べたけど、参考になるようなものが無くて。
自分の調べ方が悪いのか…
VisualStudioのデザイナーではうまく表示されています。
問題のコード
<Window x:Class="written_oracle.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:written_oracle"
mc:Ignorable="d"
Title="おみくじ" Height="450" Width="800" ResizeMode="NoResize">
<Grid>
<Image Margin="70,49,507,101" Source="/おみくじ入れ.png" Stretch="Fill" Height="283.52" Width="223" ClipToBounds="True"/>
<Button Content="Button" HorizontalAlignment="Left" Height="100" Margin="435,99,0,0" VerticalAlignment="Top" Width="125"/>
<Button Content="Button" HorizontalAlignment="Left" Height="100" Margin="355,314,0,0" VerticalAlignment="Top" Width="125"/>
<Button Content="Button" HorizontalAlignment="Left" Height="100" Margin="640,219,0,0" VerticalAlignment="Top" Width="125"/>
</Grid>
</Window>
発生している問題・エラー
自分で試したこと
paddingなるものがあるらしいのでプロパティーを見たけど見当たらなかった。
ClipToBoundsをTrueにしてみた。
0 likes