Search code examples
wpfxamlwindows-phone

How to draw separate circle in XAML?


How can I draw a circle like this, 2 colors in 2 parts. I'm coding in xaml

enter image description here

<Ellipse Fill="White" HorizontalAlignment="Center" VerticalAlignment="Center" Width="300" Height="300">

                    </Ellipse>

                    <Path VerticalAlignment="Top" Fill="Brown" HorizontalAlignment="Left">
                        <Path.Data>
                            <PathGeometry>
                                <PathFigure StartPoint="59,150">
                                    <ArcSegment SweepDirection="Clockwise" Size="141,80" Point="341,150"/>
                                </PathFigure>
                            </PathGeometry>
                        </Path.Data>
                    </Path>

I try it, and the above Path not full a part 1. Help me try draw it!


Solution

  • You can also make use of the following...

       <Grid Height="200" Width="200" VerticalAlignment="Center">
            <Ellipse Fill="#FFE1B631"  />
            <Path Data="M93.88768,0 C136.17198,0 172.32661,26.244247 186.95134,63.33252 L187.77536,65.5 0,65.5 0.82401276,63.33252 C15.44875,26.244247 51.603378,0 93.88768,0 z" Fill="#FFFD450F" Height="60.26" Stretch="Fill" VerticalAlignment="Top" Margin="8,1.31,8,0"/> 
        </Grid>
    

    enter image description here