Search code examples
c#windows-runtimewriteablebitmapwriteablebitmapex

How do I add watermark text to a bitmap in WinRT?


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?


Solution

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