WPFでfolderの画像を縦横のtileに並べて表示したいです。
mnを目標にしますが、まずは22で。
https://onedrive.live.com/?id=C0989B857F2F850C%21186&cid=C0989B857F2F850C
のimageViewerをベースにするとして、
xaml
1 <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" 2 Style="{StaticResource viewerStyle}"> 3 <Image Source="{Binding Images/Path}" Stretch="Uniform"> 4 <Image.LayoutTransform> 5 <TransformGroup> 6 <!-- 拡大縮小 --> 7 <ScaleTransform 8 ScaleX="{Binding ElementName=sliderZoom, Path=Value}" 9 ScaleY="{Binding ElementName=sliderZoom, Path=Value}" /> 10 <!-- 回転 --> 11 <RotateTransform 12 Angle="{Binding ElementName=sliderRotate, Path=Value}" /> 13 </TransformGroup> 14 </Image.LayoutTransform> 15 </Image> 16 </ScrollViewer> 17 18 19```のところに、 20 21```xaml 22<ScrollViewer> 23 <StackPanel Orientation="Vertical"> 24 <StackPanel Orientation="Horizontal"> 25 <Image Source="{Binding Images/Path}" Stretch="Uniform"/> 26 <Image Source="{Binding Images/Path}" Stretch="Uniform"/> 27 </StackPanel> 28 <StackPanel Orientation="Horizontal"> 29 <Image Source="{Binding Images/Path}" Stretch="Uniform"/> 30 <Image Source="{Binding Images/Path}" Stretch="Uniform"/> 31 </StackPanel> 32 </StackPanel> 33</ScrollViewer> 34 35
としていくととりあえずできなくはなさそうなのですが。
Q1)m*nに拡張するにはcodeで書くべき?
Q2)異なるファイル(1.jpg,2.jpg,3.jpg,4.jpg)を表示するには、どのようにBindingすればよい?
ご示唆ください。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2016/07/15 02:19