Plazma sayı 2, sayfa 152

Bu sayfadaki yazılar

Sayfanın metni

Sayfa 152

} } else { for(y = y2; y <= y1; y++) { if(x1 < x2) { for(x = x1; x <= x2; x++) Plot(x, y, color); } else { for(x = x2; x <= x1; x++) Plot(x, y, color); } } } }

/** * Name : FillRectangle * Desc : Overloaded FillRectangle fonksiyonu. (x1,y1) ve (x2,y2) yerine * POINT2D sınıfından iki değişken kullanılır. * Input : (POINT2D *)p2dPoint1 * (POINT2D *)p2dPoint2 * (unsigned char)color */ void FillRectangle(POINT2D *p2dPoint1, POINT2D *p2dPoint2, unsigned char color) { FillRectangle(p2dPoint1->getX(), p2dPoint1->getY(), p2dPoint2->getX(), p2dPoint2->getY(), color); }

/** * Name : FillRectangle * Desc : Overloaded FillRectangle fonksiyonu. (x1,y1) ve (x2,y2) yerine * RECT sınıfından bir değişken kullanılır. * Input : (RECT *)rctRect * (unsigned char)color */ void FillRectangle(RECT *rctRect, unsigned char color) { FillRectangle(rctRect->getX1(), rctRect->getY1(), rctRect->getX2(), rctRect->getY2(), color); }

/** * Name : FillCircle * Desc : Parametreden gelen (x,y) koordinatlarından itibaren r * yarıçaplı daire çizer. Bresenham algoritması kullanır. * 'a ihtiyaç duymaz. * Input : (int)x * (int)y * (int)r * (unsigned char)color */ void FillCircle(int cx, int cy, int r, unsigned char color) { int x, y, i, a;

// İlk yarıyı çiz x = r; y = 0; a = 0; while(x >= y) { for(i = cx - x; i <= cx + x; i++)

Klavyeyle gezinmek için ← ve → tuşları.