How to draw a polygon on an image in WPF

   


Code XAML

  <Grid>
      <Canvas Margin="50">
          <Image Source="/taoxanh1.jpg" />
          <Path Stroke="#00FF00" StrokeThickness="2" Fill="Transparent">
              <Path.Data>
                  <PathGeometry>
                      <PathFigure StartPoint="140,70" IsClosed="True">
                          <LineSegment Point="550,70" />
                          <LineSegment Point="550,530" />
                          <LineSegment Point="140,530" />
                      </PathFigure>
                  </PathGeometry>
              </Path.Data>
          </Path>
      </Canvas>
  </Grid>

Post a Comment

Previous Post Next Post