How to draw a concave corner rectangle in WPF?

How to draw a concave corner rectangle in WPF?

+3
source share
3 answers

You can create this by using the "Path" operation in the "Expression" section ("Menu" - "Object-> Path"). I created the Path by subtracting four ellipses against the rectangle.

The Path.Data for the concave rectangle is given below, the @Kent Fredric logic in the previous answer will be useful for its implementation.

alt text http://img87.imageshack.us/img87/4539/concaverectny1.jpg

M17.200002,0L120.4,0 120.4,2.3066998E-06C120.4,6.7378696,128.10079,12.200001,137.60001,12.200001L137.60001,85.400003C128.10077,85.400003,120.4,90.862138,120.4,97.6L17.200002,97.6C17.200002,90.862151,9.4993697,85.400003,0,85.400003L0,12.199999C9.4993663,12.200015,17.200002,6.7378725,17.200002,0z

See the blog post here http://jobijoy.blogspot.com/2008/11/concave-cornered-rectangle-blend-tip.html

Another way to get this is to create a custom WPF form, as shown below.

public class ConcaveRectangle:System.Windows.Shapes.Shape
+3
source
do you mean a rectangle with concave corners?, ie: 
     ____________________
    |                    |
  __|                    |__
 |                          |
 |                          |
 |                          |
 |__                      __|
    |                    |
    |____________________|

w x h r 4 :

A :  0,0
B :  w,0
C :  w,h
D :  0,h

w = 2r
h = 2r

4 , A,B,C,D

, , :

(0,0)--(0+r,0)---(w-r,0)---(w,0)
|                              |
(0,0+r)                  (w,0+r)
|                              |
|                              |
(0,h-r)                  (w,h-r)
|                              |
(0,h)--(0+r,h)---(w-r,h)---(w,h)

.

+2

I must point out that if it is concave, the four sides are not the same and straight; thus it is not a rectangle. But I'm distracted.

0
source

Source: https://habr.com/ru/post/1699606/


All Articles