Quantcast
Channel: WriteableBitmapEx
Viewing all articles
Browse latest Browse all 360

New Post: Is it possible to add text to writeablebitmap in metro style app

$
0
0
Hi
I just want to add text to the writeablebitmap and save to .png files,
So I referenced the below discussion thread
Is it possible to add text to bitmap?
public static void DrawText(this WriteableBitmap wBmp,Point at, string text,double fontSize,Color textColor)
    {        
        TextBlock lbl = new TextBlock();
        lbl.Text = text;
        lbl.FontSize = fontSize;
        lbl.Foreground = new SolidColorBrush(textColor);
        WriteableBitmap tBmp = new WriteableBitmap(lbl, null);
        wBmp.Blit(at, tBmp, new Rect(0, 0, tBmp.PixelWidth, tBmp.PixelHeight), Colors.White, System.Windows.Media.Imaging.WriteableBitmapExtensions.BlendMode.Alpha);
    }
But this way seems like can't be used in metro style app ....

Viewing all articles
Browse latest Browse all 360

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>