WPF 图片浏览器 使用WPF可以写出很不错的图片浏览器 window1.xmal <Window x:Class="MediaShow.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="682" Width="806"> <Window.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="Dictionary1.xaml"/> </ResourceDictionary.MergedDictionaries> </ResourceDictionary> </Window.Resources> <Grid > <Grid.RowDefinitions> <RowDefinition Height="37"></RowDefinition> <RowDefinition Height="577*"></RowDefinition> <RowDefinition Height="43"></RowDefinition> </Grid.RowDefinitions> <DockPanel Height="37" Grid.RowSpan="1" VerticalAlignment="Top"> <Menu Grid.Row="0" Template="{StaticResource mycontroltemplate}" DockPanel.Dock="Top" FontSize="12" FontWeight="bold"> <MenuItem Header="文件" > <MenuItem Header="打开" Click="OpenFileClick" /> <MenuItem Header="关闭" Click="CloseFileClick" /> <MenuItem Header="退出" Click="OnQuitClick"/> </MenuItem> <MenuItem Header="操作"> <MenuItem Header="图片旋转90" Click="OnRotate90Click" /> <MenuItem Header="图片旋转-90" Click="btnRotatecounterclockwise90_Click" /> </MenuItem> <MenuItem Header="帮助"> <MenuItem Header="关于" Click="OnAboutMe" /> </MenuItem> <Menu.ItemContainerStyle> <Style TargetType="{x:Type MenuItem}"> <Setter Property="Template" Value="{StaticResource mymenuitemtemplate}"/> </Style> </Menu.ItemContainerStyle> </Menu> <Popup></Popup> </DockPanel> <ScrollViewer Margin="0,0,0,0" Name="scrollViewer" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" Grid.Row="1" Padding="4,4,4,4"> <ScrollViewer.Background> <ImageBrush ImageSource="/MediaShow;component/blue.jpg"/> </ScrollViewer.Background> <Grid ShowGridLines="False" ClipToBounds="False"> <Image Name="img" Stretch="Fill" Visibility="Visible"> </Image> <Border HorizontalAlignment="Stretch" Name="border1" VerticalAlignment="Stretch" BorderThickness="1" CornerRadius="1,1,1,1" BorderBrush="LightBlue"> <Border.BitmapEffect> <OuterGlowBitmapEffect GlowSize="1" GlowColor="LightBlue" Noise="0" /> </Border.BitmapEffect> </Border> </Grid> </ScrollViewer> <Grid Grid.Row="2" Margin="0.5,0,0.5,1"> <Grid.BitmapEffect> <OuterGlowBitmapEffect GlowColor="DarkViolet" /> </Grid.BitmapEffect> <Grid.BitmapEffectInput> <BitmapEffectInput /> </Grid.BitmapEffectInput> <Grid.Background> <ImageBrush ImageSource="/MediaShow;component/blue.png" ></ImageBrush> </Grid.Background> <StackPanel Height="43" Name="stackPanel1" VerticalAlignment="Center" Orientation="Horizontal" ClipToBounds="True" HorizontalAlignment="Center" > <Button Height="23" Name="btnFitSwitch" Width="75" Margin="10" Click="btnFitSwitch_Click" Background="Green" Foreground="White" FontSize="14" FontWeight="bold">FitSwitch</Button> <Button Height="23" Name="btnPrevious" Width="75" HorizontalContentAlignment="Center" Margin="10" Click="btnPrevious_Click" Background="Green" Foreground="White" FontSize="14" FontWeight="bold">上一个</Button> <Button Height="23" Name="btnPlaySwitch" Width="75" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10" Background="Green" Foreground="White" FontSize="14" FontWeight="bold">停止</Button> <Button Height="23" Name="btnNext" Width="75" HorizontalAlignment="Right" Margin="10" Click="btnNext_Click" Background="Green" Foreground="White" FontSize="14" FontWeight="bold">下一个</Button> <Button Height="23" Name