Zinnerox
Zinnerox

Reputation: 35

How to add to Ellipse a polygon.

Is it possible to draw polygon on ellipse in xaml? Something like this:

<Ellipse  
        <Polygon Points="8,0 16,16, 0,16"  Fill="Black" Margin="143,51,141,233" />

I need it because I would like to rotate an elipse. Polygon should rotate with elipse.

Upvotes: 0

Views: 182

Answers (1)

Chrille
Chrille

Reputation: 1453

Put both shapes in a canvas and rotate the canvas using RotateTransform

<Canvas>
  <Canvas.RenderTransform>
       <RotateTransform CenterX="0" CenterY="0" Angle="45" />
  </Canvas.RenderTransform>
  <Ellipse />
  <Polygon />
</Canvas>

Upvotes: 3

Related Questions