Mega Code Archive

 
Categories / VB.Net / WPF
 

Combine two circles into one shape using CombinedGeometry

<Window x:Class="CombinedGeometryExample"   xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"   xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"   Title="Combined Geometry" Height="340" Width="300">   <Border Margin="5" BorderBrush="Black" BorderThickness="1" HorizontalAlignment="Left">     <Canvas Width="300" Height="340" Margin="5">           <Path Fill="LightBlue" Stroke="Blue"             Margin="10,0,0,0">             <Path.Data>               <CombinedGeometry                 GeometryCombineMode="Exclude">                 <CombinedGeometry.Geometry1>                   <EllipseGeometry Center="50,50"                     RadiusX="50" RadiusY="50" />                 </CombinedGeometry.Geometry1>                 <CombinedGeometry.Geometry2>                   <EllipseGeometry Center="80,50"                     RadiusX="50" RadiusY="50" />                 </CombinedGeometry.Geometry2>               </CombinedGeometry>             </Path.Data>           </Path>     </Canvas>   </Border> </Window>