Advertisement
sudarsanyes

DPI Sample Without Px

Aug 26th, 2014
463
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <Window x:Class="ImageDPISamples.MainWindow"
  2.        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3.        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4.        Title="MainWindow"
  5.        WindowState="Maximized">
  6.     <Window.Resources>
  7.         <Style TargetType="{x:Type Image}">
  8.             <Setter Property="Stretch"
  9.                    Value="None" />
  10.         </Style>
  11.     </Window.Resources>
  12.     <ScrollViewer>
  13.         <Grid ShowGridLines="True">
  14.             <Grid.RowDefinitions>
  15.                 <RowDefinition Height="200" />
  16.                 <RowDefinition Height="200" />
  17.                 <RowDefinition Height="200" />
  18.                 <RowDefinition Height="200" />
  19.                 <RowDefinition Height="200" />
  20.             </Grid.RowDefinitions>
  21.             <Grid.ColumnDefinitions>
  22.                 <ColumnDefinition Width="200" />
  23.                 <ColumnDefinition Width="200" />
  24.                 <ColumnDefinition Width="200" />
  25.                 <ColumnDefinition Width="200" />
  26.                 <ColumnDefinition Width="200" />
  27.                 <ColumnDefinition Width="200" />
  28.             </Grid.ColumnDefinitions>
  29.             <TextBlock Text="196 DPI"
  30.                       FontSize="24"
  31.                       VerticalAlignment="Center"
  32.                       HorizontalAlignment="Center" />
  33.             <Image Source="pack://application:,,,/ImageDPISamples;component/Resources/info-200x200x192.png"
  34.                   Grid.Column="1"
  35.                   Grid.Row="0" />
  36.             <Image Source="pack://application:,,,/ImageDPISamples;component/Resources/info-100x100x192.png"
  37.                   Grid.Column="2"
  38.                   Grid.Row="0" />
  39.             <Image Source="pack://application:,,,/ImageDPISamples;component/Resources/info-48x48x192.png"
  40.                   Grid.Column="3"
  41.                   Grid.Row="0" />
  42.             <Image Source="pack://application:,,,/ImageDPISamples;component/Resources/info-32x32x192.png"
  43.                   Grid.Column="4"
  44.                   Grid.Row="0" />
  45.             <Image Source="pack://application:,,,/ImageDPISamples;component/Resources/info-16x16x192.png"
  46.                   Grid.Column="5"
  47.                   Grid.Row="0" />
  48.             <TextBlock Text="120 DPI"
  49.                       FontSize="24"
  50.                       VerticalAlignment="Center"
  51.                       HorizontalAlignment="Center"
  52.                       Grid.Column="0"
  53.                       Grid.Row="1" />
  54.             <Image Source="pack://application:,,,/ImageDPISamples;component/Resources/info-200x200x120.png"
  55.                   Grid.Column="1"
  56.                   Grid.Row="1"
  57.                   SnapsToDevicePixels="True" />
  58.             <Image Source="pack://application:,,,/ImageDPISamples;component/Resources/info-100x100x120.png"
  59.                   Grid.Column="2"
  60.                   Grid.Row="1" />
  61.             <Image Source="pack://application:,,,/ImageDPISamples;component/Resources/info-48x48x120.png"
  62.                   Grid.Column="3"
  63.                   Grid.Row="1" />
  64.             <Image Source="pack://application:,,,/ImageDPISamples;component/Resources/info-32x32x120.png"
  65.                   Grid.Column="4"
  66.                   Grid.Row="1" />
  67.             <Image Source="pack://application:,,,/ImageDPISamples;component/Resources/info-16x16x120.png"
  68.                   Grid.Column="5"
  69.                   Grid.Row="1" />
  70.             <TextBlock Text="96 DPI"
  71.                       FontSize="24"
  72.                       VerticalAlignment="Center"
  73.                       HorizontalAlignment="Center"
  74.                       Grid.Column="0"
  75.                       Grid.Row="2" />
  76.             <Image Source="pack://application:,,,/ImageDPISamples;component/Resources/info-200x200x96.png"
  77.                   Grid.Column="1"
  78.                   Grid.Row="2"
  79.                   SnapsToDevicePixels="True" />
  80.             <Image Source="pack://application:,,,/ImageDPISamples;component/Resources/info-100x100x96.png"
  81.                   Grid.Column="2"
  82.                   Grid.Row="2" />
  83.             <Image Source="pack://application:,,,/ImageDPISamples;component/Resources/info-48x48x96.png"
  84.                   Grid.Column="3"
  85.                   Grid.Row="2" />
  86.             <Image Source="pack://application:,,,/ImageDPISamples;component/Resources/info-32x32x96.png"
  87.                   Grid.Column="4"
  88.                   Grid.Row="2" />
  89.             <Image Source="pack://application:,,,/ImageDPISamples;component/Resources/info-16x16x96.png"
  90.                   Grid.Column="5"
  91.                   Grid.Row="2" />
  92.             <TextBlock Text="72 DPI"
  93.                       FontSize="24"
  94.                       VerticalAlignment="Center"
  95.                       HorizontalAlignment="Center"
  96.                       Grid.Column="0"
  97.                       Grid.Row="3" />
  98.             <Image Source="pack://application:,,,/ImageDPISamples;component/Resources/info-200x200x72.png"
  99.                   Grid.Column="1"
  100.                   Grid.Row="3" />
  101.             <Image Source="pack://application:,,,/ImageDPISamples;component/Resources/info-100x100x72.png"
  102.                   Grid.Column="2"
  103.                   Grid.Row="3" />
  104.             <Image Source="pack://application:,,,/ImageDPISamples;component/Resources/info-48x48x72.png"
  105.                   Grid.Column="3"
  106.                   Grid.Row="3" />
  107.             <Image Source="pack://application:,,,/ImageDPISamples;component/Resources/info-32x32x72.png"
  108.                   Grid.Column="4"
  109.                   Grid.Row="3" />
  110.             <Image Source="pack://application:,,,/ImageDPISamples;component/Resources/info-16x16x72.png"
  111.                   Grid.Column="5"
  112.                   Grid.Row="3" />
  113.         </Grid>
  114.     </ScrollViewer>
  115. </Window>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement