gpt4 book ai didi

c# - 在功能区上重复使用图像会导致 XP 崩溃

转载 作者:太空宇宙 更新时间:2023-11-03 16:35:54 25 4
gpt4 key购买 nike

我正在使用 WPF 功能区,但我遇到了一些奇怪的行为。我有一个上下文选项卡,我从主页选项卡复制了一些功能,这样我的用户就不必来回点击。

我遇到的问题是,如果我重复使用图像,如果在 Windows XP 上运行,我的应用程序会在启动时崩溃。在 Windows 7 上没有问题。有什么想法吗?

代码:

<r:RibbonTab Header="Home">
<r:RibbonGroup Header="Clipboard">
<r:RibbonButton Label="Paste" LargeImageSource="Resources\Images\Paste.ico" Command="{Binding PasteCommand}"/>
<r:RibbonButton Label="Cut" SmallImageSource="Resources\Images\Cut.ico" Command="{Binding CutCommand}"/>
<r:RibbonButton Label="Copy" SmallImageSource="Resources\Images\Copy.ico" Command="{Binding CopyCommand}"/>
</r:RibbonGroup>

.... Other Code...

<r:RibbonTab Header="Options" ContextualTabGroupHeader="Options">
<r:RibbonTab.Style>
<Style TargetType="r:RibbonTab">
<Style.Triggers>
<Trigger Property="Visibility" Value="Visible">
<Setter Property="IsSelected" Value="True" />
</Trigger>
</Style.Triggers>
</Style>
</r:RibbonTab.Style>

.... If I uncomment this next part it crashes on XP....
<!--<r:RibbonGroup Header="Clipboard">
<r:RibbonButton Label="Paste" LargeImageSource="Resources\Images\Paste.ico" Command="{Binding PasteCommand}"/>
<r:RibbonButton Label="Cut" SmallImageSource="Resources\Images\Cut.ico" Command="{Binding CutCommand}"/>
<r:RibbonButton Label="Copy" SmallImageSource="Resources\Images\Copy.ico" Command="{Binding CopyCommand}"/>
</r:RibbonGroup>-->

如果我取出 LargeImageSource/SmallImageSource 部分,它工作正常。

最佳答案

不确定这是否对您有帮助。

有一段时间我的应用程序在 WinXP 上崩溃时发生了类似的事情。结果是我用于 Windows 的图标。 XP 系统似乎无法正确处理全彩色、透明、大图标。更改为小的非透明图像并开始工作。

关于c# - 在功能区上重复使用图像会导致 XP 崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9117915/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com