Skip to main content

Posts

Showing posts with the label Program to draw 3 concentric circlel

Some Graphics Mode Graphics Functions in C programming

putpixel( ): Plot a point with specified color. Its syntax is Putpixel (int x, int y, int color), getpixel( ): gets color of specified pixel. Its syntax is integer_variable = getpixel (int x, int y); setcolor( ) : It changes current drawing/ foreground color. Its syntax is setcolor (int color); setbkcolor( ): It changes the background color. Its syntax is setbkcolor(int color); line( ): The line ( ) function can draw a line. The syntax of line( ) function is: line(x1, y1, x2, y2), where x1, y1, x2, y2 are integer type and they represent the coordinate (x1, y1) and (x2, y2). The above command draws a line joining two points with coordinates (x1, y1) and (x2, y2). lineral( ): the function lineral (x, y) draws a line joining the current cursor position and a point at a distance of x in the horizontal and y in vertical direction. Note that x and y both are integer type. lineto( ): The function lineto (x, y) draws a line joining the current cursor position ...