替换 UIElements 动画时如何提高 Silverlight WritableBitmap 质量
我正在制作一个动画,暂时降低 UIElement
的可见性并覆盖原始 Image
的 WritableBitmap
版本。
我遇到的问题是,当我在带有文本的元素上执行此操作时,会产生明显模糊且较暗的图像,这意味着从 UIElement
到 Image
的切换非常明显。
有没有人经历过这个和/或知道如何处理这个问题?
I'm doing an animation where I temporarily drop down the visibility of UIElement
s and overlay WritableBitmap
versions of the original Image
.
The problem I have is that when I do this on element with text, it results in a noticeably blurry and darker image meaning the switch from UIElement
to Image
is noticeable.
Has anyone experienced this and/or know how to deal with this issue?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
对于标准文本呈现,Silverlight 使用 ClearType。不幸的是,不能使用 ClearType 将文本渲染为 WritableBitmap。这就是您在场景中看到文本质量差异的原因。顺便说一句,将 CacheMode 设置为 BitmapCache 或使用像素着色器也会禁用 ClearType(请参阅 http: //forums.silverlight.net/forums/p/109627/247959.aspx)
由于渲染到 WritableBitmap 中的文本质量无法提高,我能想到的唯一解决方案是降低 UI 的文本渲染质量使用我上面提到的方法之一。
For standard text rendering Silverlight uses ClearType. Unfortunatly, ClearType can not be used then rendering text into WritableBitmap. That is why you see the difference in text quality in your scenario. Btw setting CacheMode to BitmapCache or using pixel shaders will disable ClearType as well (see http://forums.silverlight.net/forums/p/109627/247959.aspx)
Since quality of the text rendered into WritableBitmap can not be improved the only solution I can think of is to reduce text rendering quality of your UI using one of the methods I mentioned above.
您是否考虑过添加
到插件对象标记中,
其中
xxxxx
是您将用WritableBitmap
覆盖的元素。使用这种方法也许一开始就不需要WritableBitmap
。Have you considered adding
to the plug in object tag and
Where
xxxxx
is the element which you would otherwise cover with aWritableBitmap
. Using this approach perhaps theWritableBitmap
would not be needed in the first place.