2013-03-09 76 views
0

我正在为Windows Phone 7.1编写程序并使用组件图像,我在其中拉伸图像 - 并且它变得模糊。我研究过这样的问题 - 它看起来像UseLayoutRounding =“True”应该有所帮助,但它对我没有帮助。 下面是代码:Windows Phone应用程序中的模糊图像

<Grid x:Name="LayoutRoot" UseLayoutRounding="True" Background="Transparent"> 
    <controls:Panorama x:Name="mainPanorama" Title="life rpg" SelectionChanged="Panorama_SelectionChanged_1"> 
     <controls:Panorama.Background> 
      <ImageBrush ImageSource="Imgs/bg.jpg"/> 
     </controls:Panorama.Background> 
     <controls:PanoramaItem Header="main" Tag="main" > 
      <StackPanel Name="mainPanel"> 
       <StackPanel Orientation="Horizontal"> 
        <Image HorizontalAlignment="Left" Height="165" VerticalAlignment="Top" Width="165" Source="picture.png" Margin="0 0 20 0"/> 
        <Image Name="swordImg" HorizontalAlignment="Left" Height="50" VerticalAlignment="Top" Width="50" Source="Imgs/swords/swordLVL1.png" Stretch="Fill" /> 
        <Image Name="armorImg" HorizontalAlignment="Left" Height="100" VerticalAlignment="Top" Width="100" Source="Imgs/armors/armorLVL1.png" Stretch="Uniform" /> 
        <Image Name="shieldImg" HorizontalAlignment="Left" Height="150" VerticalAlignment="Top" Width="150" Source="Imgs/shields/shieldLVL1.png" Stretch="UniformToFill" />       
       </StackPanel> 
<!--LayoutRoot is the root grid where all page content is placed--> 

+0

尝试使用图像上的RenderOptions玩法,您可能会找到一个不错的设置,例如'RenderOptions.BitmapScalingMode =“HighQuality”',并且不确定在电话7上“SnapToDevicePixels”是否可用,但如果是尝试'SnapToDevicePixels =“True”' – 2013-03-09 23:43:59

+0

什么是图像分辨率? – 2013-03-09 23:48:07

+0

图像分辨率为25x25我尝试缩放x2,x4,x6 – sergant88 2013-03-10 00:43:03

回答

0

如果当在大尺寸显示的图像的质量是非常重要的,那么你有2种选择。

  1. 从大图像开始。当位图变大时,位图图像会受到失真。这将根据JPEG文件中使用的压缩/质量设置进行放大。

  2. 使用图库的矢量格式。

0

由于图像分辨率较低(假设它是光栅格式而不是矢量),因此无法在不损失质量的情况下对其进行升级。没有渲染选项可以帮助你。

Panorama背景的25x25图像绝对不够质量明智。

相关问题