WPF格式 - 将DrawingGroup调整为列和行定义

时间:2013-10-01 21:41:03

标签: c# wpf xaml

我有这个定义

<Grid>
    <Grid.RowDefinitions>
        <RowDefinition Height="*"></RowDefinition>
        <RowDefinition Height="*"></RowDefinition>
        <RowDefinition Height="*"></RowDefinition>
    </Grid.RowDefinitions>
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="*"></ColumnDefinition>
        <ColumnDefinition Width="*"></ColumnDefinition>
        <ColumnDefinition Width="*"></ColumnDefinition>
    </Grid.ColumnDefinitions>
    ***

我在该网格中有这个元素

<Grid Grid.Row="0" Grid.Column="2">
    <Image Stretch="None" HorizontalAlignment="Left" Name="Detractor" Width="Auto" Height="Auto" VerticalAlignment="Top">
        <Image.Source>
            <DrawingImage PresentationOptions:Freeze="True">
                <DrawingImage.Drawing>
                    <DrawingGroup xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
                        <DrawingGroup x:Name="DrawingLayer">
                            <DrawingGroup.ClipGeometry>
                                <RectangleGeometry Rect="0,0,108,208" />
                            </DrawingGroup.ClipGeometry>
                            <GeometryDrawing Brush="#FFFFFFFE">
                                <GeometryDrawing.Geometry>
                                    <PathGeometry FillRule="Nonzero" Figures="M0,0L108,0 108,208 0,208 0,0z" />
                                </GeometryDrawing.Geometry>
                            </GeometryDrawing>
                            <GeometryDrawing Brush="#FFF29C44">
                                <GeometryDrawing.Geometry>
                      ....<Big element definition>....

元素定义大于指定的正方形

如何将元素调整到我的方块中?图像是人体

http://i40.tinypic.com/294ihjb.png

0 个答案:

没有答案