64,691
社区成员
发帖
与我相关
我的任务
分享
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
//---------------------------------------------------------------------------
//#pragma argsused ;
using namespace std;
int main(int argc, char* argv[])
{
HWND hWnd=FindWindowA(NULL,argv[0]); //找到程序运行窗口的句柄;
HDC hDC=GetDC(hWnd);//通过窗口句柄得到该窗口的设备场境句柄;
HPEN hPen; //画笔;
hPen=CreatePen(PS_DASH,2,0x00ff00);//生成绿色画笔;
SelectObject(hDC,hPen);//把画笔引入设备场境 ;
Arc(hDC,100,100,300,300,350,500,350,500);//画圆 ;
SelectObject(hDC,hPen);//复原 ;
//下面是对比,表明它确实是控制台程序;
printf("hello console");
//这个是画圆形的函数(椭圆)
HDC pdc=GetDC(hWnd);
Ellipse(pdc,50,50,100,100);
system("pause");
return 0;
}
void yuan(int w ,int h)
{
double x(0);double y(0);
for (int i=0;i<360;i+=60)
{
for (int j=0;j<360;j+=60)
{
y = cos((double)j)*h;
}
x = sin((double)i)*w;
}
HDC hdc;
AngleArc(hdc,9,8,10,0,360);
}