English 中文(简体)
• 如何在XAML(Windows 8 Metro)中“float”图像
原标题:How to "float" image in XAML (Windows 8 Metro)

能够在XAML中做一些事情,例如:在CSS中 image取形象。 我需要做这样的事情:

“entergraph

具有可变的形象层面和文字长度。

http://www.ohchr.org。 在我的案件中,围绕图像的文字压力不是静止的,而是在C#法典中写成一个文本Block要素清单(有Runs)。

最佳回答

解决办法似乎是利用本介绍中描述的RichTextBlockOverflow and OverflowContentTarget:

问题回答

This question seems to be asking for something similar to what you want. The answer here should prove a solution to what you desire.

答复摘要采用,例如:

<FlowDocument>
    <Paragraph>
        <Floater HorizontalAlignment="Left">
            <BlockUIContainer>
                <Image Source="/FlowDocumentTest;component/dog.png" Width="100" /> 
            </BlockUIContainer>
        </Floater>
        Here is where the text goes to wrap around the image.
    </Paragraph>
</FlowDocument>

<>Update>

As your question states, you are now using some C# code to generate TextBlock/Run Elements, both can be children of a Paragraph object. So simply name your Paragraph like so:

<FlowDocument>
    <Paragraph x:Name="textPara">
        <Floater HorizontalAlignment="Left">
            <BlockUIContainer>
                <Image Source="/FlowDocumentTest;component/dog.png" Width="100" /> 
            </BlockUIContainer>
        </Floater>
    </Paragraph>
</FlowDocument>

之后在C#中,在文本Para(即)上添加以下生成的<代码>TextBlock或Runs至

var runToInsert = new Run("Some text to display");
textPara.Inlines.InsertAfter(textPara.Inlines.FirstInline, runToInsert);




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...