// シンプル円描画2(値のより近いピクセルを選択する方式) void ReallySimpleCircle2 (HDC hdc, LONG radius, POINT center, COLORREF col){ LONG cx = 0, cy=radius; double xLimit = sqrt ((double) (radius * radius) / 2); // 45度→r*√2 double d1, d2; for (cx=0; cx <= xLimit ; cx++){ d1 = (cx * cx + cy * cy) - radius * radius; d2 = (cx * cx +(cy-1)*(cy-1)) - radius * radius; if (abs(d1)>abs(d2)) cy--; SetPixel (hdc, cx + center.x, cy