C/C++ week
Save up to 80 % on our C and C++ e-learning courses. Only this week!
Get up to 50 % extra points for free! More info

Shapes in C# .NET WPF

The program uses drawing from the Path class. The Path class is derived from the Shape class, which is derived from the UIElement, respectively the FrameWorkElement, so full interaction options are available within the user interface.

At the same time, because to the Path.Data property can be assigned any geometry (PathGeometry, CombinedGeometry, GeometryGroup), it's possible to render even relatively complex geometric shapes.

Application allows

  • parametrically inserting basic shapes - ellipse, rectangle
  • drawing closed polygons or open compound lines by clicking the mouse button
  • inserting texts as geometric objects, with the selected type, typeface and font size
  • coloring the geometric shapes
  • moving with shapes using mouse
  • combining geometric shapes using union, subtraction, intersection and Xor operations;

The program features Snap to Grid function, which is useful for drawing polygons accurately, or for positioning objects precisely before combining them.

When writting the program, I came across the absence of ColorPicker in WPF. Therefore, my own solution for this feature is included in the application.

If anybody gets lost, all functions can be found either in the main menu or in the context menu by right-clicking on the geometric shape object. If necessary, it's of course possible to contact me.


Gallery

Program was created in 2018.

 

Download

Downloaded 1x (313.47 kB)
Application includes source codes in language C# .NET

 

All articles in this section
C# .NET Community Projects - WPF Form Applications
Program has been written for you by Bruno Schwarzbach
Avatar
Do you like this article?
No one has rated this quite yet, be the first one!
Activities (1)

 

 

Comments

To maintain the quality of discussion, we only allow registered members to comment. Sign in. If you're new, Sign up, it's free.

No one has commented yet - be the first!