Reputation: 323
I am trying to draw in C# for the first time and I have a problem with positioning. I made some background but I have problem to finish it. I always destroy the whole figure...
I need to change down edges and make them soft/rounded like on mobile screen. I have tried to change this, but I don't understand where to input <ArcSegment>
(or some other command) and how to rotate that part of edge.
This is how my .xaml
code looks:
<Path.Data>
<PathGeometry>
<PathFigure StartPoint="0,0">
<ArcSegment Size="50,50" RotationAngle="180" IsLargeArc="True" SweepDirection="Clockwise" Point="500,0"/>
<LineSegment Point="500,400"/>
<LineSegment Point="450,500"/>
<LineSegment Point="50,500" />
<LineSegment Point="0,400"/>
<LineSegment Point="0,0" />
</PathFigure>
</PathGeometry>
</Path.Data>
After my code I got:
Thank you in advance!
Upvotes: -1
Views: 465
Reputation: 323
Here is how I solved my problem.
<LineSegment Point="0,475"/>
<BezierSegment Point1="0,475" Point2="0,500" Point3="25,500" />
<LineSegment Point="475,500" />
<BezierSegment Point1="475,500" Point2="500,500" Point3="500,475" />
<LineSegment Point="500,0" />
I have applied BezierSegment
to make rounded/soft edges.
Explanation:
In BezierSegment
I have three points. I drew first LineSegment
which is going to the first red arrow, then I set the same spot to be the first point. After that I move to spot where is going to be rounded shape, and then I place Point3
which will connect another two. I did the same thing for right part.
Also, you can check curved angle in this answer. There are a lot more things described there. It seems to be the same thing, but I didn't understand how to apply it at that time because I didn't know about the name of BezierSegment
and I was confused with all other commands.
At least I presented a specific case of layout and code, hope it will help someone.
Upvotes: 0