企业🤖AI Agent构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
## Polyline函数 ``` //函数功能:Polyline 函数将指定数组的连接点绘制成一系列线段(折线)。 BOOL Polyline( _In_ HDC hdc, _In_ const POINT *lppt, _In_ int cPoints ); ``` ## aardio函数 ``` //BOOL Polyline(_In_ HDC hdc,_In_ const POINT *lppt,_In_ int cPoints); ::Polyline = g.api("Polyline","int(ptr hdc,struct lppt,int cPoints)"); //BOOL PolylineTo(_In_ HDC hdc,_In_ const POINT *lppt,_In_ DWORD cCount); ::PolylineTo = g.api("PolylineTo","int(ptr hdc,struct lppt,int cCount)"); //BOOL PolyPolyline(_In_ HDC hdc,_In_ const POINT *lppt,_In_ const DWORD *lpdwPolyPoints,_In_ DWORD cCount); ::PolyPolyline = g.api("PolyPolyline","int(ptr hdc,struct lppt,int lpdwPolyPoints,int cCount)"); ``` ## 示例 ``` case 0xF/*_WM_PAINT*/ { gdi.paint( hwnd, function( hdc,width, height,rcPaint,fErase,paintStruct ){ gdi.drawLine(hdc,0,height/2,width,height/2) gdi.drawLine(hdc,width/2,0,width/2,height) // 第一种:直接写api数组 var points = { int value[12] = {50;50;100;100;150;50;200;100;250;50;300;100} } ::Polyline(hdc,points,6) // 第二种:raw.toarray 创建动态数组 var d = {}; var num = 100000; for(i=0;num;1){ var x = width*i/num var y = height*(1-math.sin(2*math.pi*i/num))/2 d[i+1] = ::POINT(x,y) } var points = raw.toarray(d) //转换成api数组 ::Polyline(hdc,points,num+1) ::BitBlt(hdc, 0, 0, width, height, hMemDc, 0, 0, 0xCC0020/*_SRCCOPY*/); } ); } ```