pathgeometry

Extract numbers from String

允我心安 提交于 2019-12-02 07:13:52
I have to parse a String to create a PathSegmentCollection . The string is composed of numbers separated by comas and/or (any) whitespaces (like newline, tab, etc...), also the numbers can be written using scientific notation. This is an example: "9.63074,9.63074 -5.55708e-006 0 ,0 1477.78" And the points are: P1(9.63074, 9.63074), P2(-0,555708, 0), P3(0, 1477.78) To extract numbers I use a regular expression: Dim RgxDouble As New Regex("[+-]?\b[0-9]+(\.[0-9]+)?(e[+-]?[0-9]+)?\b") Dim Matches As MatchCollection = RgxDouble.Matches(.Value) Dim PSegmentColl As New PathSegmentCollection Dim

What's the opposite of polygon triangulation?

狂风中的少年 提交于 2019-12-02 01:08:15
After I've done a 2D triangulation, some triangles have the same color and I want to recombine them for drawing into like-colored graphics paths. I find that if I just draw the triangles one by one, some graphic renderers shows seams between the triangles (at least if anti-aliasing and/or transparency is involved). So how do I take a set of (non-overlapping) triangles and produce a graphics path, which may contain holes and disjoint polygons? Blindly adding the triangles to a graphics path actually works pretty well for filling (though not for stroking, of course), but it doesn't feel right to

WPF - Path/Geometry help - Strange shape

☆樱花仙子☆ 提交于 2019-11-30 21:50:36
Anyone know a good way to create this object from Xaml? It also has to work at .5 Opacity when layered on top of other controls. It also has to be resizable via Horizontal or Vertical Alignment. Shape http://monitor.utopiaselfscan.com/test.bmp I'm having some difficulty. The closest I get is with 2 borders, one having a negative margin--but it doesn't work when Opacity is applied. Code that works: <Path Fill="Black"> <Path.Data> <CombinedGeometry GeometryCombineMode="Exclude"> <CombinedGeometry.Geometry1> <RectangleGeometry RadiusX="5" RadiusY="5" Rect="0,0,200,100" /> </CombinedGeometry

Convert path to geometric shape

别等时光非礼了梦想. 提交于 2019-11-30 19:46:59
Hey everyone I have tried to sum up and come with the basic question and my idea which does not work so far :S Basicly my question is: The user adds elements together, and I want to create a new element based on these figures, such that a new path can be made for the users defined element. Lets say I have a square and a triangle. The user combines this to a house. Now I want to make the house an element for the user. For this I need the path of the element, how do I create this? My Idea The figure elements which are used are based on path strings. Therefore I want these to be converted to a

Convert path to geometric shape

你。 提交于 2019-11-30 04:09:16
问题 Hey everyone I have tried to sum up and come with the basic question and my idea which does not work so far :S Basicly my question is: The user adds elements together, and I want to create a new element based on these figures, such that a new path can be made for the users defined element. Lets say I have a square and a triangle. The user combines this to a house. Now I want to make the house an element for the user. For this I need the path of the element, how do I create this? My Idea The

Setter.TargetName does not work against an element from the BasedOn setting

血红的双手。 提交于 2019-11-28 01:56:30
问题 I have many PathGeometry instances that draw a variety of graphics for different buttons. So I have created a button type for showing a Path which then updates the Path.Stroke depending on the button state. So show it grayed when disabled and different colours when the mouse is over. Standard stuff... <Style x:Key="BasePathButton" TargetType="{x:Type Button}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type Button}"> <Border Name="Border" <Path x:Name="Path" /