簡體   English   中英

在TextBlock中圍繞圖像換行文本

[英]Wrap text around the image in TextBlock

如何在TextBlock中圍繞圖像包裝文本?

文字總是在底部......

這是一般的基本方法嗎?

在此輸入圖像描述

謝謝!

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..."});

我建議將它們放入網格中的兩個不同的列中......

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM