当前位置:网站首页>[project training 10] drawing of arrows
[project training 10] drawing of arrows
2022-06-23 06:56:00 【From winter】
A common use SVG The drawing is an arrow . One line of code can create a , But the code is very repetitive . You can also be in <defs> and <symbol> And then reuse it , But you need to move or rotate it every time you apply it . Use one... Directly <marker> Element will facilitate the ownership of many copyrights by the author .
marker It is a method that can connect one or more path,line,polyline,polygon The flag type of the vertex of . The most common use case is to draw an arrow or mark a line on the output (polymarker) graphics .
Arrows are path Drawing .
marker The special feature of the is that they can adjust the direction according to the direction of the application object . No, right <marker> Make any adjustments to the contents of , The arrow automatically adjusts to and line In the same direction .
Can be set by maker-end, And maker-start Attach the arrow to the end or start point of the line
Example
end_arrow = std::make_shared<Lewzen::SVGIMarker>();
end_arrow->Id = "end_arrow";
end_arrow->MarkerHeight = 13;
end_arrow->MarkerWidth = 13;
end_arrow->RefX = 2;
end_arrow->RefY = 3;
end_arrow->Orient = "auto";
arrowPath = std::make_shared<Lewzen::SVGIPath>();
arrowPath->D = "M0,0 L6,3 L0,6 L2,3 L0,0";
arrowPath->Fill = "black";
end_arrow->add(arrowPath);
start_arrow = std::make_shared<Lewzen::SVGIMarker>();
start_arrow->Id = "start_arrow";
start_arrow->MarkerHeight = 13;
start_arrow->MarkerWidth = 13;
start_arrow->RefX = 2;
start_arrow->RefY = 3;
start_arrow->Orient = "auto";
std::shared_ptr<Lewzen::SVGIPath> enda = std::make_shared<Lewzen::SVGIPath>();
enda->D = "M4,3 L6,0 L0,3 L6,6 L4,3";
enda->Fill = "black";
start_arrow->add(enda);By drawing correctly <maker> Internal elements , You can draw different types of arrows .
Among them orient, This attribute is why I am converting line In the direction of , There is no need to adjust marker Why . It accepts a auto value , Or an angle value , This value determines marker Do you want to rotate .
Set to auto , Indicates that the direction of the arrow is consistent with the direction of the end of the line .
refX,refY Represents the coordinates of the points connected with the graphic elements .
边栏推荐
- Mysql5.6 (5.7-8) is based on shardingsphere5.1.1 sharding proxy mode. Read / write separation
- VS2013 FFMPEG环境配置及常见错误处理
- 2.17 haas506 2.0开发教程-system(仅支持2.2以上版本)
- 【STL】关联容器之unordered_map用法总结
- Haas506 2.0 development tutorial - Advanced Component Library -modem Voicecall (only supports versions above 2.2)
- 反鸡汤致辞
- core.js是什么---kalrry
- Focusing on the smart city, Huawei cooperates with China Science and technology Xingtu to jointly develop a new digital blue ocean
- Qt 中 QVariant 使用总结
- Linux安装mysql8.0.25
猜你喜欢

English语法_形容词比较级 - 3级变化

为什么TCP协议是三次握手而不是两次?

English grammar_ Adjective comparative - Level 3 change

Open source ecology 𞓜 super practical open source license basic knowledge literacy post (Part 2)

Storage mode of data in memory (C language)

idea自动生成serialVersionUID

小白投资理财必看:图解基金买入与卖出规则

Common setup modes (Abstract Factory & responsibility chain mode & observer mode)

Qt 中 QVariant 使用总结

20220621 Three Conjugates of Dual Quaternions
随机推荐
Swagger3 integrates oauth2 authentication token
Centos7 MySQL records
Common setup modes (Abstract Factory & responsibility chain mode & observer mode)
Topic35——34. 在排序数组中查找元素的第一个和最后一个位置
asp.net文件下载demo与相关问题的处理
Leetcode notes: Weekly contest 298
mars3d点线面的绘制和重置
Chrome remove duplicate bookmarks
【日常训练】513. 找树左下角的值
system 权限程序不能访问sd卡问题
Chrome删除重复书签
常见设置模式(抽象工厂&责任链模式&观察者模式)
2022-01-12: give a positive array arr, length N, subscript 0~n-1, a
30 data visualization tips that can not be ignored
Network architecture from Wan to sd-wan edge devices
关于监督
MySQL index
VS2013 FFMPEG环境配置及常见错误处理
SAP execution transaction code mrrl error -no message was found for partner 100065-
微信小程序 - 全局监听globalData的某个属性变化,例如监听网络状态切换