Graphics - 7
• Graph function :--
• Setlinestyle ( pattern , user pattern, line width ) : this
function sets the style for a line, first parameter is pattern
solid line , dashed line ( from 0 to 4 where 4 is user defined
pattern. Second is user defined pattern number, and third
is line width which may be 1 or 3.
• Line (start x, start y , end x, end y) : first two cordinates
make the start point and last two coordinates make the
end point of the line.
• Setfillstyle(style type,color) : this first paramter in this
function has 0 to 11 fill style where 0 means no fill and 1
means solid fill etc. and second parameter is color of fill.
• Fillellipse(midx,midy,xradius,yradius) : to this function fills
the ellipse in the pattern which is mentioned by setfillstyle
function or otherwise solid fill is used.
• Cleardevice () : clears the drawing made upto.
Assignment – 25-01-2022
• Q.1 WAP TO DRAW A TRIANGLE USING LINE
FUNCTION ON THE SCREEN.
• Q.2 WAP TO DRAW A PENTAGON USING LINE
FUNCTION ON THE SCREEN.
• Q.3 WAP TO DRAW A LOOK OF BUS/CAR ON
THE SCREEN