WPF Path 画箭头

原文:WPF Path 画箭头

代码:

<Window x:Class="WpfApplication1.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525" WindowStartupLocation="CenterScreen">
    <Grid Background="White">
        <Border Width="36" Height="36">
            <Path Fill="Red" Data="M -15,8 L 17,17 C 17,17 19,18 17,19 L 17,19 L -15,28 C -15,28 -17,28.2 -16,26 L -16,26 L -5,18 L -16,10 C -16,10 -17,8.5 -15,8 Z"></Path>
        </Border>
    </Grid>
</Window>

设计图:

运行效果图:

效果图放大:

原文地址:https://www.cnblogs.com/lonelyxmas/p/10641702.html

时间: 2024-07-29 03:50:19

WPF Path 画箭头的相关文章

WPF画图の利用Path画扇形(仅图形)

一.画弧 Path继承自Sharp,以System.Windows.Shapes.Shape为基类,它是一个具有各种方法的控件. 我们先看一段xaml代码: <Path Stroke="Red"> <Path.Data> <PathGeometry> <PathFigure StartPoint="100,0"> <ArcSegment Point="200,100" Size="1

WPF画箭头

前段时间,因工作需要利用WPF画箭头,在参考Using WPF to Visualize a Graph with Circular Dependencies后.自己写了一个WPF画箭头的库. 先上效果图, XAML代码如下: <Window x:Class="WPFArrows.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="

WPF使用Path画圆的一个示例代码

原文:WPF使用Path画圆的一个示例代码 <Path Fill="red" Data="M 0,0 A 20,20 45 1 1 0,1 Z"/> 1. Fill是指Path的填充颜色 2. Data是Path的路径, M 0,0  --画笔移到0,0处: A 20,20 --画半径为20的圆弧: 45 1 1 --- 45为转角角度,1:是否有大小弧,画椭圆时才有用:1:顺时针 0,1 --- 终点 Z --- 闭合 原文地址:https://www

SVG 使用marker画箭头(一)

一.使用Marker画箭头 1.定义一个箭头的marker引用 <defs> <marker id='markerArrow' markerWidth='13' markerHeight='13' refx='2' refy='6' orient='auto'> <path d='M2,2 L2,11 L10,6 L2,2' style='fill:#00ff00' /> </marker> </defs> 注:orient="auto

WPF带小箭头的按钮

原文:WPF带小箭头的按钮 XAML代码: <ControlTemplate x:Key="btnTpl" TargetType="RadioButton"> <StackPanel Orientation="Vertical" Height="30" Background="Transparent"> <Border Name="border" Backg

android 使用Canvas画箭头

public class MyCanvas extends View{        private Canvas myCanvas;    private Paint myPaint=new Paint();        public MyCanvas(Context context) {        super(context);        // TODO Auto-generated constructor stub    }     public MyCanvas(Context

使用Canvas画箭头

canvas是HTML5的一个新添加的元素,HTML5 canvas是一个原生HTML绘图薄,用于Javascript代码,不使用第三方工具. canvas部分方法列表: 方法 用途 getContext(contextId) 公开在 canvas 上绘图需要的 API.惟一(当前)可用的 contextID 是 2d. height 设置 canvas 的高度.默认值是 150 像素. width 设置 canvas 的宽度.默认值是 300 像素. createLinearGradient(

WPF中画虚线

原文:WPF中画虚线 在WPF中,画线的方法十分简单,只要声明一个Line然后添加到指定的位置就可以了,但Line并不仅仅只能画一条直线,还可以对直线进行修饰. 1.Line.StrokeDashArray属性 StrokeDashArray是一个双精度字符串,指示用于勾勒形状轮廓的虚线和间距的样式. 2.Line.StrokeDashCap属性 获取或设置一个 PenLineCap 枚举值,该值指定如何绘制虚线的两端. 3.Line.StrokeEndLineCap和Line.StrokeSt

WPF 如何画一颗心

原文:WPF 如何画一颗心 如何用WPF画一个心. MainWindow.xaml <Window x:Class="Heart.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://sch