如何在玻璃上获得可读文本 (wpf) [英] How to get readable text on the glass (wpf)

查看:26
本文介绍了如何在玻璃上获得可读文本 (wpf)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下面是两张截图:

白色背景上的全玻璃窗:
http://trotsenko.com.ua/stackoverflow/2010_01_13%20Glass%20Window%20over%20a%20white%20background.png

A full-glass window over white background:
http://trotsenko.com.ua/stackoverflow/2010_01_13%20Glass%20Window%20over%20a%20white%20background.png

背面背景相同的全玻璃窗:
http://trotsenko.com.ua/stackoverflow/2010_01_13%20The%20same%20Glass%20Window%20over%20a%20Black%20background.png

The same full-glass window over back background:
http://trotsenko.com.ua/stackoverflow/2010_01_13%20The%20same%20Glass%20Window%20over%20a%20Black%20background.png

问题是:在 WPF 中,我如何使用 TextBlock 使其在玻璃上可读?

The question is: in WPF, how do I use TextBlock so that it will be readable on the glass?

我已经试过了 没有可接受的成功.(也许我做错了?)

I already tried <DropShadowEffect ShadowDepth="0" BlurRadius="20" Color="White"/> with no acceptable success. (Maybe I did smth wrong ?)

我没有成功使用 <OuterGlowBitmapEffect/>(我认为,因为位图效果现在已被弃用.我做错了什么?)

I didn't succeed with <OuterGlowBitmapEffect/> (I think, because bitmap effects are now deprecated. Did I do smth wrong?)

推荐答案

我认为您可以使用 dwmapi.dll 中的原生 DrawThemeTextEx() 方法,但我不知道如何在 WPF 中执行此操作.我发现的所有示例都使用 WinForms.

I think you could use the native DrawThemeTextEx() method in dwmapi.dll, but I don't know how to do this in WPF. All examples I found were using WinForms.

这篇关于如何在玻璃上获得可读文本 (wpf)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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