使图像控件根据主题反转其颜色 [英] Making an image control invert its colors depending on theme

查看:30
本文介绍了使图像控件根据主题反转其颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试解决如何让我的 Windows Phone 应用程序中的 Image 控件根据全局背景设置(Dark"或Light")选择的颜色反转用户在设置->主题->背景.

I'm trying to work out how to have an Image control in my Windows Phone application invert its colors based on the global background setting (either "Dark" or "Light") chosen by the user in Settings->Themes->Background.

推荐答案

没有内置的方法来反转框架内的图像颜色.

There is no built-in way to invert image colors within the framework.

相反,由于在手机上执行此操作的开销较大,您应该在设计/构建时创建图像的两个版本,然后通过检测 主题可见性和不透明度.

Instead, because of the overhead of doing this on the phone, you should create both versions of the image at design/build time and then choose which version to display from your code by detecting Theme Visibility and Opacity.

这篇关于使图像控件根据主题反转其颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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