💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
## 1、扇形和弦图的区别 ![](https://img.kancloud.cn/85/c3/85c33b716f062185d9e972f0cd33a3df_733x325.png) ## 2、结果 ![](https://img.kancloud.cn/21/6d/216d49b3a23c50b5dd066554185b71c1_599x246.png) ## 3、代码 ``` import gdi import console console.open() polygon = ::Gdi32.api("Polygon","bool(ptr hdc, struct apt, int cpt)" ) pie = ::Gdi32.api("Pie","bool(ptr hdc, int x1,int y1,int x2,int y2,int xr1,int yr1,int xr2,int yr2)" ) //BOOL Chord( HDC hdc, int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4 ); chord = ::Gdi32.api("Chord","bool(ptr hdc, int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4)" ) winform.custom.wndproc = function(hwnd,message,wParam,lParam){ select(message) { case 0xF/*_WM_PAINT*/ { gdi.paint( hwnd, function( hdc,width, height,rcPaint,fErase,paintStruct ){ // 创建画笔和画刷 var hBrush = ::CreateHatchBrush(2,0x83B314) var hPen = ::CreatePen(0/*_PS_SOLID*/,2,0xFF0000) // 放入hdc var oBrush = ::SelectObject(hdc,hBrush) var oPen = ::SelectObject(hdc,hPen) // 点数据 var points = { int value[10] = {50;50; 100;50; 200;100; 100;100; 50;200} } // 画扇形和画弦 pie(hdc,50,50,250,150,80,20,200,20) //pie(hdc,50,50,250,150,200,20,80,20) chord(hdc,300,50,500,150,480,20,350,200) //chord(hdc,300,50,500,150,350,200,480,20) // 还原画笔画刷 ::SelectObject(hdc,oBrush) ::SelectObject(hdc,oPen) // 删除画笔画刷 ::DeleteObject(hBrush) ::DeleteObject(hPen) ::BitBlt(hdc, 0, 0, width, height, hMemDc, 0, 0, 0xCC0020/*_SRCCOPY*/); } ); } } } ```