how to write text on a image using windows phone code? [duplicate]

微笑、不失礼 提交于 2019-12-19 04:47:26

问题


Possible Duplicate:
Write text on image in WP7

I have an app and one of the feature I want to add to it is , sending the picture with some text on top of it.IS that possible to code this in windows phone ?


回答1:


Easy way is just rendering a TextBlock with the text on a WriteableBitmap

private void RenderString(WriteableBitmap bitmap, string stringToRender)
{
    TextBlock textBlock = new TextBlock();
    textBlock.Text = stringToRender;

    // set font, size, etc. on textBlock

    bitmap.Render(textBlock, null);
    bitmap.Invalidate();
}


来源:https://stackoverflow.com/questions/13979607/how-to-write-text-on-a-image-using-windows-phone-code

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!