Created
February 4, 2025 08:08
-
-
Save Fatima-progmmer/357bd0d1352dfa4d814b145ce2b94cb7 to your computer and use it in GitHub Desktop.
Graphic on C++
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <msoftcon.h> | |
class circle | |
{ | |
protected: | |
int xCo.yCo; | |
int radius; | |
color fillcolor; | |
fstyle fillstyle; | |
public: | |
void set(int x, int y, int r, color FC, fstyle fs) | |
{ | |
xCo = x; | |
yCo = y; | |
radius = r; | |
fillcolor = fc; | |
fillstyle = fs; | |
} | |
void draw() | |
{ | |
set_color(fillcolor); | |
set_fill_style(fillstyle); | |
draw_circle(xCo, yCo, radius); | |
} | |
}; | |
int main() | |
{ | |
; | |
init_graphics(); | |
circle c1; | |
circle c2; | |
circle c3; | |
c1.set(15, 7, 5, cBLUE, X_FILL); | |
c2.set(41, 12, 7, cRED, O_FILL); | |
c3.set(65, 18, 4, cGREEN, MEDIUM_FILL); | |
c1.draw(); | |
c2.draw(); | |
c3.draw(); | |
set_cursor_pos(1, 25); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment