#include "myWin.h" #include "math.h" int cTab[8]= {0xFF7777,0x770000, 0xFF3333, 0x77FF77, 0x007700,0xFF0000, 0x0033FF, 0x0000FF}; double PI=3.1415926535897932385; static HDC hBuff; static HBITMAP hBM; static int M=3; void drawCircle(HDC hdc,double X0, double Y0, double R, int N){ int NN= N % 8; if(R<0.5){ SetPixel(hdc,(int)X0, (int)Y0,cTab[NN]) ;return; } double DTH=PI/M, RR=R*sin(DTH)/(sin(DTH)+1), RX=R-RR; double TH=0, DT=2*PI/M; int NC = NN+2; for(int i=0;i9) M=3; procLButtonDown(hw,wp,lp); } LRESULT CALLBACK WndProc(HWND hw, UINT msg, WPARAM wp,LPARAM lp){ switch(msg){ case WM_DESTROY : PostQuitMessage(0) ; return 0; case WM_CREATE : procCreate(hw,wp,lp) ; return 0; case WM_PAINT : procPaint(hw,wp,lp) ; return 0; case WM_TIMER : procTimer(hw,wp,lp) ; return 0; case WM_LBUTTONDOWN : procLButtonDown(hw,wp,lp) ; return 0; } return DefWindowProc(hw,msg,wp,lp); }