C#WPF应用程序显示像素化图像/文本

时间:2019-02-16 18:43:41

标签: c# wpf image

今天,我鼓励了一些从未发生过的奇怪的事情,而我以前从未在任何地方经历过。 因此,让我详细介绍一下,我的朋友制作了一个带有图层的Photoshop图像,我将使用它来制作一个软件,但是,当我尝试在wpf应用程序上逐个添加图层并修复后,通过使用Stretch东西的长宽比,我发现它看起来并不完全与Photoshop中的原始图片相似,例如,我把所有的图层都放了,当然每一层都是分开的,因为稍后我将与他们,让我给你看一些图像。 但是看起来仍然缺少一些像素,并且文字显示不正确。

这是程序界面:

The program interface

这是Photoshop图片:

Photoshop image

这是我的XML代码:

<Window x:Class="OlympusSimple.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="MainWindow" ResizeMode="NoResize" WindowStyle="None" mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" Height="400" Width="800">
<Grid>
    <Image Height="400" HorizontalAlignment="Left" Name="BackgroundUpbarBlur" Stretch="Uniform" StretchDirection="Both" VerticalAlignment="Top" Width="800" Source="/OlympusSimple;component/Images/BackgroundUpbarBlur.png" Margin="0,0,0,0" />
    <Image Height="400" HorizontalAlignment="Left" Name="BackgroundUpbar" Stretch="Uniform" StretchDirection="Both" VerticalAlignment="Top" Width="800" Source="/OlympusSimple;component/Images/BackgroundUpbar.png" Margin="0,0,0,0" />
    <Image Height="400" HorizontalAlignment="Left" Name="Olympus" Stretch="Uniform" StretchDirection="Both" VerticalAlignment="Top" Width="800" Source="/OlympusSimple;component/Images/Olympus.png" Margin="0,0,0,0" />
    <Image Height="400" HorizontalAlignment="Left" Name="Upbar" Stretch="Uniform" StretchDirection="Both" VerticalAlignment="Top" Width="800" Source="/OlympusSimple;component/Images/UpBar.png" Margin="0,0,0,0" />
    <Image Height="400" HorizontalAlignment="Left" Name="Minimize" Stretch="Uniform" StretchDirection="Both" VerticalAlignment="Top" Width="800" Source="/OlympusSimple;component/Images/Minimize.png" Margin="0,0,0,0" />
    <Image Height="400" HorizontalAlignment="Left" Name="FullScreen" Stretch="Uniform" StretchDirection="Both" VerticalAlignment="Top" Width="800" Source="/OlympusSimple;component/Images/FullScreen.png" Margin="0,0,0,0" />
    <Image Height="400" HorizontalAlignment="Left" Name="Close" Stretch="Uniform" StretchDirection="Both" VerticalAlignment="Top" Width="800" Source="/OlympusSimple;component/Images/Close.png" Margin="0,0,0,0" />
    <Image Height="400" HorizontalAlignment="Left" Name="SelectFile" Stretch="Uniform" StretchDirection="Both" VerticalAlignment="Top" Width="800" Source="/OlympusSimple;component/Images/SelectFile.png" Margin="0,0,0,0" />
    <Image Height="400" HorizontalAlignment="Left" Name="SelectDestination" Stretch="Uniform" StretchDirection="Both" VerticalAlignment="Top" Width="800" Source="/OlympusSimple;component/Images/SelectDestination.png" Margin="0,0,0,0" />
    <Image Height="400" HorizontalAlignment="Left" Name="ButtonDiscordUnready" Stretch="Uniform" StretchDirection="Both" VerticalAlignment="Top" Width="800" Source="/OlympusSimple;component/Images/ButtonDiscordUnready.png" Margin="0,0,0,0" />
    <Image Height="400" HorizontalAlignment="Left" Name="RestoreAll" Stretch="Uniform" StretchDirection="Both" VerticalAlignment="Top" Width="800" Source="/OlympusSimple;component/Images/RestoreAll.png" Margin="0,0,0,0" />
    <Image Height="400" HorizontalAlignment="Left" Name="Tutorial" Stretch="Uniform" StretchDirection="Both" VerticalAlignment="Top" Width="800" Source="/OlympusSimple;component/Images/Tutorial.png" Margin="0,0,0,0" />
    <Image Height="400" HorizontalAlignment="Left" Name="Twitter" Stretch="Uniform" StretchDirection="Both" VerticalAlignment="Top" Width="800" Source="/OlympusSimple;component/Images/Twitter.png" Margin="0,0,0,0" />
    <Image Height="400" HorizontalAlignment="Left" Name="Patreon" Stretch="Uniform" StretchDirection="Both" VerticalAlignment="Top" Width="800" Source="/OlympusSimple;component/Images/Patreon.png" Margin="0,0,0,0" />
    <Image Height="400" HorizontalAlignment="Left" Name="Discord" Stretch="Uniform" StretchDirection="Both" VerticalAlignment="Top" Width="800" Source="/OlympusSimple;component/Images/Discord.png" Margin="0,0,0,0" />


</Grid>

我已经搜索并没有找到任何可以使我找到解决方案的内容,因此,如果有人可以帮助我,将不胜感激。

0 个答案:

没有答案