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

发布于 2025-01-02 02:25:50 字数 1963 浏览 6 评论 0原文

我正在使用 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 部分,它就可以正常工作。

I am using a WPF ribbon and I have just run into some strange behavior. I have a contextual tab which I duplicate some of the functionality from the Home tab so that my users don't have to click back and forth.

The problem I have seen is that if I reuse an image, my application crashes on start up if running on Windows XP. There is no issue on Windows 7. Any ideas?

Code:

<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>-->

If I take out the LargeImageSource/SmallImageSource part it works fine.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

甜心小果奶 2025-01-09 02:25:50

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

我曾经遇到过类似的情况,我的应用程序在 WinXP 上崩溃了。原来是我在 Windows 上使用的图标。 XP 系统似乎无法正确处理全彩色、透明、大图标。更改为小的不透明图像,它开始工作。

Not sure if this would help you.

It happened me some time with something similar with my app crashing on WinXP. It turns out the Icon I used for my Windows. It seems that full colored, transparent, big icons are not correctly handled by XP systems. Changed to small non-transparent images and it started to work.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文