我目前正在开发地铁应用程序,我需要在图片上写文字。
我找到了这个http://writeablebitmapex.codeplex.com/
但我对XAML还是新手,而且我知道如何具体地使用它。所以,有人能告诉我如何使用它来在图像上写文字吗?
因为我已经在MSDN上问过这个问题,但我还没有得到答复。
编辑:
如果我使用Muad‘’Dib,我将得到如下屏幕截图所示的错误:

错误是:'Writeable Bitmap Extensions' is ambiguous in the namespace 'System.Windows.Media.Imaging'
发布于 2012-03-17 19:15:25
在WriteableBitmapEx的讨论范围中有一个可能的解决方案
以下是该“文章”的代码:
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);
}https://stackoverflow.com/questions/9752746
复制相似问题