How to add watermark text to a bitmap in WinRT?

I would like to do something like http://weblogs.asp.net/broux/archive/2011/02/08/silverlight-how-to-watermark-a-writeablebitmapimage-with-a-text.aspx . It is very difficult for me to get this to work in WinRT. I use the WriteableBitmap extensions to β€œrender” some text, but I want it to look like it looks in this example. Any suggestions or help?

+4
source share
2 answers

You can display this text in the png resource and split it on top of the bitmap. If the text does not have to be dynamic, you will need DirectWrite. The WinRT XAML Toolkit has an extension method that you can use to render text in WriteableBitmap.

0
source

This does the job visually:

<Grid> <Image Source="{Binding MyImage}" /> <Image Source="{Binding MyWatermark}" /> </Grid> 

This is certainly the same effect without any work. If you want to make it literally make the watermark a part of the original image, uploading to the service is your only current option. Without the Render() method on WriteableBitmap there is no other option for you. The problem even is that the XAML Toolkit does not solve this problem. This is a general request.

But depending on your use case, this may be exactly what you want!

I hope so. Good luck.

0
source

All Articles