我如何水印文本添加到的WinRT位图? [英] How do I add watermark text to a bitmap in WinRT?
问题描述
我想这样做的 http://weblogs.asp.net/broux/archive/2011/02/08/silverlight-how-to-watermark-a-writeablebitmapimage-with-a-text。 ASPX 。我有一个艰难的时间得到这个在WinRT的工作。我使用WriteableBitmap的扩展来渲染一些文字,但我希望它看起来完全像它看起来在这个例子中。任何建议或帮助?
I would like to do something like this http://weblogs.asp.net/broux/archive/2011/02/08/silverlight-how-to-watermark-a-writeablebitmapimage-with-a-text.aspx. I am having a tough time getting this to work in WinRT. I am using the WriteableBitmap extensions to "render" some text but I want it to look exactly like it looks in this example. Any suggestions or help?
推荐答案
您可能使该文本为PNG资产,它的blit的位图的顶部。除非文本需要是动态的 - 那么你需要的DirectWrite。 WinRT的XAML工具包有你可以用它来渲染文本到WriteableBitmap的扩展方法。
You could render that text to a png asset and blit it on top of the bitmap. Unless the text needs to be dynamic - then you'd need DirectWrite. WinRT XAML Toolkit has an extension method you could use to render text to a WriteableBitmap.
这篇关于我如何水印文本添加到的WinRT位图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!