테두리의 경계까지 항상 늘어나는 테두리 컨트롤 (또는 유사한 모양) 내에서 간단한 선을 그릴 필요가 있습니다. 줄만 늘어 뜨릴 수는 있지만 펜은 늘리지 않을 방법이 있습니까? C#을 많이 사용하지 않고? 이 버전에서 펜을 펴지 않고 뻗는 WPF 도면
은 라인 스트레칭 : 이<Border>
<Border.Background>
<DrawingBrush>
<DrawingBrush.Drawing>
<DrawingGroup>
<GeometryDrawing Brush="Red">
<GeometryDrawing.Geometry>
<GeometryGroup>
<RectangleGeometry Rect="0,0 100,1000" />
<LineGeometry StartPoint="0,0" EndPoint="100,1000"/>
<LineGeometry StartPoint="100,0" EndPoint="0,1000"/>
</GeometryGroup>
</GeometryDrawing.Geometry>
<GeometryDrawing.Pen>
<Pen Thickness="20" Brush="Black"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
</DrawingGroup>
</DrawingBrush.Drawing>
</DrawingBrush>
</Border.Background>
</Border>
내가 함께 온 가장 좋은 방법은 이것이다 :
<Border>
<Grid>
<Path Stretch="Fill" Fill="Red" Stroke="Black" StrokeThickness="4" Data="M0,0 L100,0 100,1000 0,1000 z" />
<Path Stretch="Fill" Stroke="Black" StrokeThickness="4" Data="M 0,0 L0,0 100,1000" />
<Path Stretch="Fill" Stroke="Black" StrokeThickness="4" Data="M 100,0 L100,0 0,1000" />
</Grid>
</Border>
그러나 더 나은 솔루션이 아닌가요? 그것은 여분의 그리드를 포함하지 않습니다?
정말 끝내주는 팁! 절망적 인 시간이나 많은 수의 변환기를 절약 해주었습니다. –