#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <windows.h>
int main()
{
char title[200];
HWND hwnd;
RECT rect;
POINT pt;
HDC hdc;
int i;
HPEN hpen;
GetConsoleTitleA(title,200);
hwnd=FindWindowA(NULL,title);
GetClientRect(hwnd,&rect);
pt.x=rect.right/2;
pt.y=rect.bottom/2;
hdc=GetDC(hwnd);
Rectangle(hdc,pt.x-10,pt.y,pt.x+10,pt.y+200);
SelectObject(hdc,GetStockObject(NULL_BRUSH));
for(i=1;i<=100;i++)
{
hpen=CreatePen(PS_SOLID,1,RGB(10*i%256,20*i%256,30*i%256));
SelectObject(hdc,hpen);
Ellipse(hdc,pt.x-i,pt.y-i,pt.x+i,pt.y+i);
DeleteObject(hpen);
}
return 0;
}
C语言画棒棒糖
最新推荐文章于 2022-03-20 19:45:55 发布