0% found this document useful (0 votes)
241 views12 pages

Graphics Programming Basics in C/C++/Python

The document provides code snippets and instructions for drawing various basic shapes and implementing fundamental graphics algorithms in programming languages like C/C++ and Python. It includes steps to draw a coordinate axis, divide the screen into regions and draw shapes in each, draw basic shapes like circles and rectangles, and implement algorithms for drawing lines, circles and ellipses like DDA, Bresenham's and the midpoint circle algorithm. Code and links are provided for visual explanations of completing the graphics exercises.

Uploaded by

Shreya Kale
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
241 views12 pages

Graphics Programming Basics in C/C++/Python

The document provides code snippets and instructions for drawing various basic shapes and implementing fundamental graphics algorithms in programming languages like C/C++ and Python. It includes steps to draw a coordinate axis, divide the screen into regions and draw shapes in each, draw basic shapes like circles and rectangles, and implement algorithms for drawing lines, circles and ellipses like DDA, Bresenham's and the midpoint circle algorithm. Code and links are provided for visual explanations of completing the graphics exercises.

Uploaded by

Shreya Kale
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

1.

Solve the following:


a. Study and enlist the basic functions used for graphics in C / C++ / Python language. Give an
example for each of them.
Ans:-

initgraph imagesize
setcolor settextstyle
closegraph resetendpt
outtextxy setfillstyle
putpixel getpixel
delay setlinestyle
boudryfill

b. Draw a co-ordinate axis at the center of the screen.


Ans:-

Video lecture:- https://www.youtube.com/c/TirupParmar @ Notes @ https://t.me/bscit


2. Solve the following:
a. Divide your screen into four region, draw circle, rectangle, ellipse and half ellipse in each region with
appropriate message.

Video lecture:- https://www.youtube.com/c/TirupParmar @ Notes @ https://t.me/bscit


b. Draw a simple hut on the screen.

Video lecture:- https://www.youtube.com/c/TirupParmar @ Notes @ https://t.me/bscit


3. Draw the following basic shapes in the center of the screen :
i. Circle
ii. Rectangle
iii. Square
iv. Concentric Circles
v. Ellipse
vi. Line

Video lecture:- https://www.youtube.com/c/TirupParmar @ Notes @ https://t.me/bscit


Video lecture:- https://www.youtube.com/c/TirupParmar @ Notes @ https://t.me/bscit
Video lecture:- https://www.youtube.com/c/TirupParmar @ Notes @ https://t.me/bscit
4. Solve the following:
a. Develop the program for DDA Line drawing algorithm.

Video lecture:- https://www.youtube.com/c/TirupParmar @ Notes @ https://t.me/bscit


Video lecture:- https://www.youtube.com/c/TirupParmar @ Notes @ https://t.me/bscit
b. Develop the program for Bresenham’s Line drawing algorithm.

Video lecture:- https://www.youtube.com/c/TirupParmar @ Notes @ https://t.me/bscit


Video lecture:- https://www.youtube.com/c/TirupParmar @ Notes @ https://t.me/bscit
5. Solve the following:
a. Develop the program for the mid-point circle drawing algorithm.

Video lecture:- https://www.youtube.com/c/TirupParmar @ Notes @ https://t.me/bscit


b. Develop the program for the mid-point ellipse drawing algorithm.

Video lecture:- https://www.youtube.com/c/TirupParmar @ Notes @ https://t.me/bscit

You might also like