我在ScrollViewer中有一个Image控件,并将TIFF文件设置为其源.在某些高度值(介于图像实际高度的40%至60%的范围内)上以黑色覆盖层显示的图像 [英] I've a Image control inside a ScrollViewer and TIFF file set as its source. Image displayed with black overlay for some height values (in range of 40% to 60% of image's actual height)

查看:68
本文介绍了我在ScrollViewer中有一个Image控件,并将TIFF文件设置为其源.在某些高度值(介于图像实际高度的40%至60%的范围内)上以黑色覆盖层显示的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

WPF:我在ScrollViewer中有一个Image控件,并将TIFF文件设置为其源.在某些高度值(介于图像实际高度的40%到60%的范围内)中,以黑色覆盖层显示的图像.这需要以某种方式解决.仅在某些高度范围内会发生此问题,当更改为其他高度时,它会正常工作.

WPF:  I've a Image control inside a ScrollViewer and TIFF file set as its source. Image displayed with black overlay for some height values (in range of 40% to 60% of image's actual height).  This need to be resolved somehow. Only for some height range this problem occurs and when changed to other height it works normal.

<ScrollViewer
 
Grid
.
Column
=
"2"
 
Margin
=
"5"
 
HorizontalScrollBarVisibility
=
"Visible"
 
VerticalScrollBarVisibility
=
"Visible"
>

   
<Image Source = "doc.tif" Grid . Row = "0" Height = "3510" Stretch = "Uniform" StretchDirection = "Both" />
</ScrollViewer>


推荐答案

您好,Anwarcode,

Hi Anwarcode,

我对此进行了测试,但是无法重现此问题.您能否提供一个简化且易于运行的示例来演示您遇到的问题?

I have made a test for that, but I cannot reproduce this issue. Could you please provide a simplified and ready-to-run example to demonstrate the issue you are encountering?

这是我的测试代码,如下所示:
XAML

This is my test code as follows:
XAML

< ; 窗口 : ='"WpfApplication1.ScrollViewImage"

=" http://schemas .microsoft.com/winfx/2006/xaml/presentation;

    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

: x =" http://schemas.microsoft.com/winfx/2006/xaml"

    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

=" ScrollViewImage" 高度 ="300" 宽度 ="300">

    Title="ScrollViewImage" Height="300" Width="300">

< >

< 边距 =可见" VerticalScrollBarVisibility =可见"

< 来源 ="3510-1" =" Uniform" StretchDirection

            <Image Source="htl.tif" Height="3510" Stretch="Uniform" StretchDirection="Both"/>

</ ScrollViewer </ 网格 </ >

图像显示完美,也许图像之间有些区别.

The image displays perfect, maybe there’s something difference between the images.

谢谢,
刘琳达

Thanks,
Linda Liu


这篇关于我在ScrollViewer中有一个Image控件,并将TIFF文件设置为其源.在某些高度值(介于图像实际高度的40%至60%的范围内)上以黑色覆盖层显示的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆