Disable interpolation of child elements in Windows RT

喜夏-厌秋 提交于 2019-12-11 18:14:42

问题


Right now I have a ScrollViewer control in a Windows Store Application which surrounds an Image element. I am trying to make a pixel art editor but when the ScrollViewer is zoomed in the Image's contents are interpolated. Is there currently any way to force the image to be scaled in nearest neighbor mode?

EDIT: I decided I should put some code to clarify what I'm trying to do, so here it is:

<ScrollViewer
    x:Name="Container"
    HorizontalAlignment="Stretch"
    VerticalAlignment="Stretch"
    ZoomMode="Enabled"
    MinZoomFactor="0.1"
    MaxZoomFactor="100"
    HorizontalScrollMode="Enabled"
    HorizontalScrollBarVisibility="Auto"
    VerticalScrollMode="Enabled"
    VerticalScrollBarVisibility="Auto"
    ViewChanged="OnContainerViewChanged">
    <Border
        x:Name="ImageBorder"
        Width="32"
        Height="32"
        BorderBrush="White"
        BorderThickness="4">
        <Grid>
            <Image
                x:Name="RenderedImage"/>
            <Image
                x:Name="EditPreview"/>
            <Canvas
                x:Name="GridContainer"
                Visibility="Collapsed"/>
            <Rectangle
                x:Name="InputCapturer"
                Fill="Transparent"
                PointerPressed="OnPointerPressed"
                PointerMoved="OnPointerMoved"
                PointerReleased="OnPointerReleased"
                PointerExited="OnPointerLeave"/>
        </Grid>
    </Border>
</ScrollViewer> 

来源:https://stackoverflow.com/questions/21869295/disable-interpolation-of-child-elements-in-windows-rt

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!