Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

Graphics - 3

• Graphic Driver
– DETECT – (Auto Detection) : Determines graphics
driver and mode to use by checking the hardware.
– Detects system’s graphics adapter and chooses the
mode that provides the highest resolution for that
adapter.
– Graphdriver is an integer that specifies the graphics
driver to be used
• Graph mode specifies the initial graphic mode
– DETECT, graphmode is set to the highest resolution
available for the detected driver.
Graphics - 4
• Initgraph function : to start the graphics system,
we first call this function initgraph.
• Initgraph initializes the graphics driver from disk
then putting the system into graphics mode.
• Initgraph ( graphicdriver, graphic mode,
path_to_driver)
– Graphic driver : auto detected driver
– Graphic mode : highest resolution mode available
– Path_to_driver : path where the driver file exists.
Graphics - 5
• Graph function :--
• Circle(x-cordinate,y-cordinate,radius) : this function draws
a complete circle from x and y co-ordinates having the
radius as mentioned.
• Ellipse(x-cordinate,y-
cordinate,stangle,endangle,xradius,yradius) : this
function draws an ellipse from starting angle to end angle.
If start angle is 0 and end angle is 360, this function draws
the complete ellipse otherwise an arc is generated. On the
other hand if the x radius is increased then the ellipse
spreads horizontally and if y radius is increased then
ellipse spreads vertically.
• Rectangle(left,top,right,bottom) : to draw rectangle we
have to give left top x y co-ordinates and right bottom x y
co-ordinates.
Graphics - 6
• Graph function :--
• Getmaxx() : This function will give a number of
total points(columns) on x axis.
• Getmaxy() : this function will give a number of
total points (rows ) on y axis.
• Setcolor (color number) : this function will take a
number as parameter and will set the color to
draw the circle , ellipse etc.

You might also like