在HDevelop中
dev_open_window (0, 0, 300, 300, 'black', WindowHandle)
gen_region_line (RegionLines, 100, 50, 150, 250)
gen_region_line (RegionLines1, 150, 50, 100, 250)
dev_display(RegionLines)
dev_display(RegionLines1)
dev_set_color ('yellow')
intersection (RegionLines, RegionLines1, RegionIntersection)
*获得区域的交集
*参数3:输出区域
dev_display(RegionIntersection)
在Qt Creator中
HObject ho_RegionLines, ho_RegionLines1, ho_RegionIntersection;
HTuple hv_WindowHandle;
SetWindowAttr("background_color","black");
OpenWindow(0,0,300,300,0,"visible","",&hv_WindowHandle);
HDevWindowStack::Push(hv_WindowHandle);
GenRegionLine(&ho_RegionLines, 100, 50, 150, 250);
GenRegionLine(&ho_RegionLines1, 150, 50, 100, 250);
if (HDevWindowStack::IsOpen())
DispObj(ho_RegionLines, HDevWindowStack::GetActive());
if (HDevWindowStack::IsOpen())
DispObj(ho_RegionLines1, HDevWindowStack::GetActive());
if (HDevWindowStack::IsOpen())
SetColor(HDevWindowStack::GetActive(),"yellow");
Intersection(ho_RegionLines, ho_RegionLines1, &ho_RegionIntersection);
//获得区域的交集
//参数3:输出区域
if (HDevWindowStack::IsOpen())
DispObj(ho_RegionIntersection, HDevWindowStack::GetActive());