在TextBlock中围绕图像换行文本

时间:2012-09-10 16:34:34

标签: c# .net wpf

如何在TextBlock中围绕图像包装文本?

文字总是在底部......

一般来说,这是一般的基本方法吗?

enter image description here

谢谢!

var image = new BitmapImage();
image.BeginInit();
image.CacheOption = BitmapCacheOption.OnLoad;
image.CreateOptions = BitmapCreateOptions.IgnoreImageCache;
image.UriSource = new Uri(@"http://cl.jroo.me/z3/P/0/C/d/a.aaa-bad-crazy-cat.jpg", UriKind.Absolute);
image.EndInit();

var imageInline = new InlineUIContainer { Child = new Image { Source = image  } };

textBlock1.Inlines.Add(imageInline);

textBlock1.Inlines.Add(new Run{ Text = "any text goes here..."});

1 个答案:

答案 0 :(得分:0)

我建议将它们放在网格中的两个不同的列中......

相关问题