Ovis_Decoration_2D_Segmented_Line_Create()
摘要
创建 2D 分段线。
语法
Ovis_Decoration_2D_Segmented_Line_Create (from, to, num_segments, color, thickness, layer_ptr, destroy_proc, user_state_ptr)
| 参数 | 类型 | 说明 |
|---|---|---|
from |
OvisT_2D_Position |
线的起点 |
to |
OvisT_2D_Position |
线的终点 |
num_segments |
unsigned char |
分段线中的段数(至少 1) |
color |
PrgT_Color |
颜色 |
thickness |
unsigned char |
分段线的粗细 |
layer_ptr |
OvisT_Layer * |
Ovis 图层 |
destroy_proc |
OvisT_Decoration_State_Destroy_Proc |
销毁与该对象关联的数据并释放其内存 |
user_state_ptr |
void * |
可选的用户提供的装饰状态 |
返回类型
OvisT_2D_Segmented_Line *
该 2D 分段线
头文件
ovis_decoration.h
详情
该函数创建 Ovis 2D 分段线,并指定分段线的各属性。
示例
OvisT_2D_Position from, to;
OvisT_2D_Segmented_Line * line;
PrgT_Color color = prg_color_from_string ("green");
from.x = to.x = 0;
from.y = 50;
to.y = -50;
line = Ovis_Decoration_2D_Segmented_Line_Create (from, to, 3, color, 1,
OPC_NIL, OPC_NIL, OPC_NIL);
错误
- 'from' 2D 位置 <x,y> 无效。2D 位置值必须在 –128 到 127 之间。
- 'to' 2D 位置 <x,y> 无效。2D 位置值必须在 –128 到 127 之间。
- 段数必须大于 0。
参考
- 使用
Ovis_2D_Line_Endpoints_Set()函数修改线的端点。 - 使用
Ovis_Decoration_Flashing_Set()函数修改整条线的闪烁状态。 - 使用 Ovis_Segmented_Line_Segment_Length_Set 函数以占线总长度的百分比指定段的大小。
- 使用
Ovis_Segmented_Line_Segment_Color_Set()函数修改线中某一段的颜色。 - 使用
Ovis_Segmented_Line_Segment_Transparency_Set()函数修改线中某一段的透明度。 - 使用
Ovis_Segmented_Line_Segment_Pattern_Set()函数修改线中某一段所使用的图案。 - 使用
Ovis_Segmented_Line_Segment_Thickness_Set()函数修改线中某一段的粗细。 - 使用
Ovis_Segmented_Line_Segment_Arrows_Set()函数启用/禁用线中某一段两端的箭头。