SlideShare a Scribd company logo
1 of 42
Graphic mode
Coordinate system
Some graphic functions
WHAT GRAPHICS ISWHAT GRAPHICS IS
Exit
Program
Exp
Explanation
Introduction
Exe file
If we want to start graphics
programming then we need two files
which are GRAPHICS.H and
GRAPHICS.LIB. The graphic mode
functions require a graphics monitor
and adapter card such as Color
Graphics Adapter(CGA), Enhanced
Graphics Adapter(EGA) and Video
Graphics Array(VGA).
GRAPHIC MODEGRAPHIC MODE
Exit
Program
Exp
Explanation
Introduction
Exe file
Traditional XY coordinate system
Graphics XY coordinate system
XY Coordinate systemXY Coordinate system
Exit
Program
Exp
Explanation
Introduction
Exe file
Traditional XY Coordinate systemTraditional XY Coordinate system
 Coordinate system
simply means that
how to pinpoint
any location on the
screen as an XY
value
 We all should be
well known of
traditional XY
coordinate system,
which is commonly
used in math.
X-axis
Y-axis
(0,0)
Exit
Program
Exp
Explanation
Introduction
Exe file
Graphics XY Coordinate systemGraphics XY Coordinate system
 Graphics coordinate systems typically
spell out the origin of the system.
 The graphics coordinate system has an
origin that is located in the upper-left
corner of the window, with +ve X values
increasing to the right and +ve Y values
increasing down. X-axis
Y-axis
(0,0)
Exit
Program
Exp
Explanation
Introduction
Exe file
 In computer the graphics XY
coordinate system is similar to
math coordinate system except it
applies to the client area of
windows.
 Client area is the area, which
doesn't include the title bar,
scrollbars, and so on.
 All values in the Graphics
coordinate system are positive
integers.
Exit
Program
Exp
Explanation
Introduction
Exe file
rectangle()
circle()
closegraph()
Some graphic functionsSome graphic functions
Exit
Program
Exp
Explanation
Introduction
Exe file
 rectangle (left,top,right,bottom) :
This function draws a rectangle with
(left,top) as upper left of the rectangle &
(right,bottom) as its lower right of the
corner.
Exit
Program
Exp
Explanation
Introduction
Exe file
Circle( ):
Circle function takes X and Y
values with respect to top left
corner of the screen and third co-
ordinate is nothing but radius of
circle..
Exit
Program
Exp
Explanation
Introduction
Exe file
Closegraph( ) : The closegraph()
swithces back the screen from grpahics
mode to text mode. If you don’t use this
function then you may have undesirable
effects.Here this function is called after
the getch() function as screen shouldn’t
switch to text mode till user hits any key.
getch( ) : getch( ) function gets a
character from console but does not
echo it on screen.This is used to pause
the screen till user hits any key.
Exit
Program
Exp
Explanation
Introduction
Exe file
Library files
Class
Functions
Main
Program ExplanationProgram Explanation
Exit
Program
Exp
Explanation
Introduction
Exe file
HEADER FILES
#include<iostream.h>
#include<conio.h>
#include<stdlib.h>
#include<graphics.h>
#include<dos.h>
Exit
Program
Exp
Explanation
Introduction
Exe file
HEADER
“Headers" are libraries of code you may
insert in your program by including
them by reference in the top block.
Exit
Program
Exp
Explanation
Introduction
Exe file
#include<iostream.h> 
Declares objects that control reading and
writing to the standard streams. This is
often the only header you need to include
to perform input and output from a C++
program.
 cerr
 cin
 cout
 wcerr
 wcin
 wcout
Exit
Program
Exp
Explanation
Introduction
Exe file
#include<conio.h>
Function Description
kbhit Determines if a keyboard key was pressed.
ungetch Puts a character back into the keyboard buffer.
putch Writes a character directly to the console.
cgets Gets a string directly from the console.
cprintf Formats and prints a string directly to the
console.
cputs Outputs a string directly to the console.
cscanf Reads and formats values directly from the
console.
Exit
Program
Exp
Explanation
Introduction
Exe file
#include<stdlib.h>
The name "stdlib" stands for
standard library.
stdlib.h includes functions involving
memory allocation, process control,
conversions and others.
Exit
Program
Exp
Explanation
Introduction
Exe file
#include<graphics.h>
This file contains definitions and
explanation of all the graphic functions
and constants.
Here we are dealing with graphic mode
function. To switch from text mode to
graphic mode, we have function called as
” initgraph ” .
Exit
Program
Exp
Explanation
Introduction
Exe file
Variables: x, y, xv, yv, r
Constructor: cirl();
Functions: Move(); cc();
cdx(); cdy();
Class of circleClass of circle
Exit
Program
Exp
Explanation
Introduction
Exe file
CLASS
class circl
{
private:
int col,r;
public:
int xv, yv;
int x, y;
Exit
Program
Exp
Explanation
Introduction
Exe file
circl()
{
x=getmaxx()/2;
y=getmaxy()/2;
col=1,r=2;
}
getmaxx: Returns the maximum value of x
getmaxy: Returns the maximum value of y
CONSTRUCTOR
Exit
Program
Exp
Explanation
Introduction
Exe file
Color palettes
 The graphics.h has declaration about
16 colors.In order to use the color in
your program you have to use the
functions like setcolor( ) ,setbkcolor( )
& setfillstyle( ).The function setcolor( )
sets the value of current drawing color
to color
 setfillstyle( ) sets the current fill pattern
and fill color
 setbkcolor( ) sets the value for
background color,which is by default
black
Exit
Program
Exp
Explanation
Introduction
Exe file
 Color ValueBlack 0
 Blue 1
 GREEN 2
 Cyan 3
 RED 4
 MAGENTA 5
 BROWN 6
 LIGHTGRAY 7
 DARKGRAY 8
 LIGHTBLUE 9
 LIGHTGREEN 10
 LIGHTCYAN 11
 LIGHTRED 12
 LIGHTMAGENTA 13
 YELLOW 14
 WHITE 15
Exit
Program
Exp
Explanation
Introduction
Exe file
Exit
Program
Exp
Explanation
Introduction
Exe file
Function
void cc(void) /*change color
{
if(col==15)
{
col=0;
}
col++;
}
EXPLANATION
 IF THE COLOR VALUE IS EQUAL TO 15
WHICH IS THE LAST COLOR VALUE THEN
WE SHOULD SET COLOR VALUE “1”
 HERE IN PROGRAM IS COL=0; IT MEANS
THAT ,HERE COLOR BECOME BLACK
WHICH WOULD BE INVISIBLE SO WE
SHOULD INCREASE COLOR BY
ONE,THAT SHOULD BE VISIBLE
Exit
Program
Exp
Explanation
Introduction
Exe file
Functions to move balls
void move(void)
{
setcolor(0);
circle(x,y,r);
x=x+xv;
y=y+yv;
setcolor(col);
circle(x,y,r);
} 0 for BLACK
Exit
Program
Exp
Explanation
Introduction
Exe file
Making 8 circles in main
circl p[8];
p[0].xv=1; p[0].yv=0;
p[1].xv=-1; p[1].yv=0;
p[2].xv=0; p[2].yv=-1;
p[3].xv=0; p[3].yv=1;
X(320)
Y(240)
If monitor has a
resolution of 640*480.
x=x+xv;
y=y+yv;
Exit
Program
Exp
Explanation
Introduction
Exe file
p[4].xv=1; p[4].yv=-1;
p[5].xv=1; p[5].yv=1;
p[6].xv=-1; p[6].yv=-1;
p[7].xv=-1; p[7].yv=1;
X(320)
Y(240)
If monitor has a
resolution of 640*480.
x=x+xv;
y=y+yv;
Exit
Program
Exp
Explanation
Introduction
Exe file
Function for changing the direction of a ballFunction for changing the direction of a ball
((x-axis))
inline void cdx(void)
{
xv=xv*-1;
cc();
}
X(320)
Y(240)
Exit
Program
Exp
Explanation
Introduction
Exe file
inline void cdy(void)
{
yv=yv*-1;
cc();
}
Function for changing the direction of a ballFunction for changing the direction of a ball
((y-axis))
X(320)
Y(240)Exit
Program
Exp
Explanation
Introduction
Exe file
Eight object of circles
MainMain
Exit
Program
Exp
Explanation
Introduction
Exe file
void main(void)
{
clrscr();
int driver=DETECT,mode;
initgraph(&driver,&mode);
int l=100,t=100,r=540,b=380;
int temp,num;
Exit
Program
Exp
Explanation
Introduction
Exe file
initgraph(&driver,&mode);
 This function selects the best
resolution and direct that value to
variable mode
 The two int variables driver,
mode are graphic driver and
graphic mode respectively.
 The mode handles value that
tells us which resolution and
monitor we are using
 The driver specifies the graphic
driver to be used. Three types of
drivers are CGA, VGA, EGA
Exit
Program
Exp
Explanation
Introduction
Exe file
for(num=0; num<=200; num++)
{
putpixel(random(640),(random(480)),4);
}
setcolor(5);
for(num=0;num<=500;num++)
{
putpixel(100+random(435),100+(random(275)),num);
}
Description:
putpixel plots a point in the color defined by color at
(x,y)
Exit
Program
Exp
Explanation
Introduction
Exe file
void putpixel(int x, int y, int color);
random
Declaration:
int random(int num);
Remarks:
random returns a random number
between 0 and num-1.
Exit
Program
Exp
Explanation
Introduction
Exe file
setcolor(5);
Definition:
setcolor sets the current drawing
color
Declaration:
void setcolor(int color);
Remarks:
setcolor sets the current drawing
color to color
Exit
Program
Exp
Explanation
Introduction
Exe file
program
 rectangle(10,10,80,80);
 Outtextxy (15,45,"pause=1");
 rectangle(100,10,170,80);
 outtextxy(105,45, ‘’ quit=2");
Exit
Program
Exp
Explanation
Introduction
Exe file
do
{
delay(5);
num=0;
while(num<=7)
{
If (p[num].x >=l&&p[num].x<=r&&p[num].y>=t&&p[num].y<=b)
{
p[num].move();
}
if (p[num].x<=l||p[num].x>=r)
{
p[num].cdx();
rectangle(100-3,100-3,540+3,280+3)
}
if (p[num].y<=t||p[num].y>=b)
{
p[num].cdy();
rectangle(100-3,100-3,540+3,380+3)
}
.
.
Exit
Program
Exp
Explanation
Introduction
Exe file
EXPLANATION
 If our circle exceed from the left side
and behind the right side of rectangle
also below from the top and above
from the bottom, means the circle is
inside the rectangle then we will move
the function by calling (“move()”)
function.
Exit
Program
Exp
Explanation
Introduction
Exe file
 If our circle is exceed from the right
side or behind the left side, then we
have to change the x-direction of
circle.
 If our circle is above the top or below
the bottom of the rectangle then we
have to change the y-direction of
circle.
Exit
Program
Exp
Explanation
Introduction
Exe file
for(temp=0;temp<=7;temp++)
{
if(num!=temp)
if(p[num].x==p[temp].x&&p[num].y==p[temp].y)
{
p[num].cdx();
p[num].cdy();
p[temp].cdx();
p[temp].cdy();
}
}
num=num+1;
} /*end while
Comparing a ball with every other ball for
finding collision
Exit
Program
Exp
Explanation
Introduction
Exe file
closegraph();
Definition:
Shuts down the graphics system
Declaration:
void closegraph(void);
Remarks:
closegraph deallocates all memory
allocated by the graphics system.
Exit
Program
Exp
Explanation
Introduction
Exe file
cleardevice();
Definition:
Clears the graphics screen
Declaration:
void cleardevice(void);
Remarks:
cleardevice erases the entire
graphics screen and moves the CP
(current position) to home (0,0).
Exit
Program
Exp
Explanation
Introduction
Exe file

More Related Content

What's hot

Computer Graphics Lab
Computer Graphics LabComputer Graphics Lab
Computer Graphics LabNeil Mathew
 
Graphics in C programming
Graphics in C programmingGraphics in C programming
Graphics in C programmingKamal Acharya
 
From Functor Composition to Monad Transformers
From Functor Composition to Monad TransformersFrom Functor Composition to Monad Transformers
From Functor Composition to Monad TransformersHermann Hueck
 
2014 computer science_question_paper
2014 computer science_question_paper2014 computer science_question_paper
2014 computer science_question_papervandna123
 
Use Applicative where applicable!
Use Applicative where applicable!Use Applicative where applicable!
Use Applicative where applicable!Hermann Hueck
 
Graphics practical lab manual
Graphics practical lab manualGraphics practical lab manual
Graphics practical lab manualVivek Kumar Sinha
 
verilog code for logic gates
verilog code for logic gatesverilog code for logic gates
verilog code for logic gatesRakesh kumar jha
 
Computer graphics lab manual
Computer graphics lab manualComputer graphics lab manual
Computer graphics lab manualUma mohan
 
Lec 11 12_sept [compatibility mode]
Lec 11 12_sept [compatibility mode]Lec 11 12_sept [compatibility mode]
Lec 11 12_sept [compatibility mode]Palak Sanghani
 
SE Computer, Programming Laboratory(210251) University of Pune
SE Computer, Programming Laboratory(210251) University of PuneSE Computer, Programming Laboratory(210251) University of Pune
SE Computer, Programming Laboratory(210251) University of PuneBhavesh Shah
 
friends functionToshu
friends functionToshufriends functionToshu
friends functionToshuSidd Singh
 
Machine-level Composition of Modularized Crosscutting Concerns
Machine-level Composition of Modularized Crosscutting ConcernsMachine-level Composition of Modularized Crosscutting Concerns
Machine-level Composition of Modularized Crosscutting Concernssaintiss
 

What's hot (20)

Computer Graphics Lab
Computer Graphics LabComputer Graphics Lab
Computer Graphics Lab
 
Advance java
Advance javaAdvance java
Advance java
 
Graphics in C programming
Graphics in C programmingGraphics in C programming
Graphics in C programming
 
From Functor Composition to Monad Transformers
From Functor Composition to Monad TransformersFrom Functor Composition to Monad Transformers
From Functor Composition to Monad Transformers
 
2014 computer science_question_paper
2014 computer science_question_paper2014 computer science_question_paper
2014 computer science_question_paper
 
Use Applicative where applicable!
Use Applicative where applicable!Use Applicative where applicable!
Use Applicative where applicable!
 
Graphics practical lab manual
Graphics practical lab manualGraphics practical lab manual
Graphics practical lab manual
 
verilog code for logic gates
verilog code for logic gatesverilog code for logic gates
verilog code for logic gates
 
Computer graphics lab manual
Computer graphics lab manualComputer graphics lab manual
Computer graphics lab manual
 
Lec 11 12_sept [compatibility mode]
Lec 11 12_sept [compatibility mode]Lec 11 12_sept [compatibility mode]
Lec 11 12_sept [compatibility mode]
 
Cg lab cse-v (1) (1)
Cg lab cse-v (1) (1)Cg lab cse-v (1) (1)
Cg lab cse-v (1) (1)
 
PRACTICAL COMPUTING
PRACTICAL COMPUTINGPRACTICAL COMPUTING
PRACTICAL COMPUTING
 
SE Computer, Programming Laboratory(210251) University of Pune
SE Computer, Programming Laboratory(210251) University of PuneSE Computer, Programming Laboratory(210251) University of Pune
SE Computer, Programming Laboratory(210251) University of Pune
 
Svitla talks 2021_03_25
Svitla talks 2021_03_25Svitla talks 2021_03_25
Svitla talks 2021_03_25
 
Java programs
Java programsJava programs
Java programs
 
friends functionToshu
friends functionToshufriends functionToshu
friends functionToshu
 
Applications
ApplicationsApplications
Applications
 
Machine-level Composition of Modularized Crosscutting Concerns
Machine-level Composition of Modularized Crosscutting ConcernsMachine-level Composition of Modularized Crosscutting Concerns
Machine-level Composition of Modularized Crosscutting Concerns
 
OpenVX 1.1 Reference Guide
OpenVX 1.1 Reference GuideOpenVX 1.1 Reference Guide
OpenVX 1.1 Reference Guide
 
Introduction to MATLAB
Introduction to MATLABIntroduction to MATLAB
Introduction to MATLAB
 

Similar to Circles graphic

Computer graphics
Computer graphicsComputer graphics
Computer graphicsamitsarda3
 
Computer graphics presentation (wecompress.com) (1).pptx
Computer graphics presentation (wecompress.com) (1).pptxComputer graphics presentation (wecompress.com) (1).pptx
Computer graphics presentation (wecompress.com) (1).pptxMehediHasan910941
 
Computer graphics practical(jainam)
Computer graphics practical(jainam)Computer graphics practical(jainam)
Computer graphics practical(jainam)JAINAM KAPADIYA
 
Graphics software
Graphics softwareGraphics software
Graphics softwareMohd Arif
 
Halide tutorial 2019
Halide tutorial 2019Halide tutorial 2019
Halide tutorial 2019Champ Yen
 
Introduction to Coding
Introduction to CodingIntroduction to Coding
Introduction to CodingFabio506452
 
License Plate Recognition System
License Plate Recognition System License Plate Recognition System
License Plate Recognition System Hira Rizvi
 
Client Side Programming with Applet
Client Side Programming with AppletClient Side Programming with Applet
Client Side Programming with Appletbackdoor
 
programming language in c&c++
programming language in c&c++programming language in c&c++
programming language in c&c++Haripritha
 
bfd23fd7-0d89-45c0-8b82-c991b30ed375.pdf
bfd23fd7-0d89-45c0-8b82-c991b30ed375.pdfbfd23fd7-0d89-45c0-8b82-c991b30ed375.pdf
bfd23fd7-0d89-45c0-8b82-c991b30ed375.pdfshehabhamad_90
 
Creating an Uber Clone - Part IV - Transcript.pdf
Creating an Uber Clone - Part IV - Transcript.pdfCreating an Uber Clone - Part IV - Transcript.pdf
Creating an Uber Clone - Part IV - Transcript.pdfShaiAlmog1
 
426 lecture 4: AR Developer Tools
426 lecture 4: AR Developer Tools426 lecture 4: AR Developer Tools
426 lecture 4: AR Developer ToolsMark Billinghurst
 

Similar to Circles graphic (20)

Graphics in C++
Graphics in C++Graphics in C++
Graphics in C++
 
Computer graphics
Computer graphicsComputer graphics
Computer graphics
 
Chapter 1
Chapter 1Chapter 1
Chapter 1
 
UNIT-II CP DOC.docx
UNIT-II CP DOC.docxUNIT-II CP DOC.docx
UNIT-II CP DOC.docx
 
Computer graphics presentation (wecompress.com) (1).pptx
Computer graphics presentation (wecompress.com) (1).pptxComputer graphics presentation (wecompress.com) (1).pptx
Computer graphics presentation (wecompress.com) (1).pptx
 
Computer graphics practical(jainam)
Computer graphics practical(jainam)Computer graphics practical(jainam)
Computer graphics practical(jainam)
 
Graphics software
Graphics softwareGraphics software
Graphics software
 
Applet life cycle
Applet life cycleApplet life cycle
Applet life cycle
 
Halide tutorial 2019
Halide tutorial 2019Halide tutorial 2019
Halide tutorial 2019
 
Introduction to Coding
Introduction to CodingIntroduction to Coding
Introduction to Coding
 
Graphics mod
Graphics modGraphics mod
Graphics mod
 
Qe Reference
Qe ReferenceQe Reference
Qe Reference
 
License Plate Recognition System
License Plate Recognition System License Plate Recognition System
License Plate Recognition System
 
Client Side Programming with Applet
Client Side Programming with AppletClient Side Programming with Applet
Client Side Programming with Applet
 
programming language in c&c++
programming language in c&c++programming language in c&c++
programming language in c&c++
 
Built in function
Built in functionBuilt in function
Built in function
 
bfd23fd7-0d89-45c0-8b82-c991b30ed375.pdf
bfd23fd7-0d89-45c0-8b82-c991b30ed375.pdfbfd23fd7-0d89-45c0-8b82-c991b30ed375.pdf
bfd23fd7-0d89-45c0-8b82-c991b30ed375.pdf
 
Creating an Uber Clone - Part IV - Transcript.pdf
Creating an Uber Clone - Part IV - Transcript.pdfCreating an Uber Clone - Part IV - Transcript.pdf
Creating an Uber Clone - Part IV - Transcript.pdf
 
Fp201 unit2 1
Fp201 unit2 1Fp201 unit2 1
Fp201 unit2 1
 
426 lecture 4: AR Developer Tools
426 lecture 4: AR Developer Tools426 lecture 4: AR Developer Tools
426 lecture 4: AR Developer Tools
 

More from alldesign

Vb lecture notes
Vb lecture notesVb lecture notes
Vb lecture notesalldesign
 
Computer graphics circle
Computer graphics   circleComputer graphics   circle
Computer graphics circlealldesign
 
Getstart graphic
Getstart graphicGetstart graphic
Getstart graphicalldesign
 
Image types,raster and vector graphics
Image types,raster and vector graphicsImage types,raster and vector graphics
Image types,raster and vector graphicsalldesign
 
Image types,raster and vector graphics
Image types,raster and vector graphicsImage types,raster and vector graphics
Image types,raster and vector graphicsalldesign
 
Graphics display devices
Graphics display devicesGraphics display devices
Graphics display devicesalldesign
 
Cg applications
Cg applicationsCg applications
Cg applicationsalldesign
 
Types of cards
Types of cardsTypes of cards
Types of cardsalldesign
 
External types of hardware
External types of hardwareExternal types of hardware
External types of hardwarealldesign
 
Devices of computer
Devices of computerDevices of computer
Devices of computeralldesign
 
Internal computer hardware
Internal computer hardwareInternal computer hardware
Internal computer hardwarealldesign
 
Computer hardware
Computer hardwareComputer hardware
Computer hardwarealldesign
 
Types of slots
Types of slotsTypes of slots
Types of slotsalldesign
 
Application of computer graphic
Application of computer graphicApplication of computer graphic
Application of computer graphicalldesign
 
What is computer graphics
What is computer graphicsWhat is computer graphics
What is computer graphicsalldesign
 
Types of rom
Types of romTypes of rom
Types of romalldesign
 
Types of ram
Types of ramTypes of ram
Types of ramalldesign
 

More from alldesign (20)

Vb lecture
Vb lectureVb lecture
Vb lecture
 
Vb lecture notes
Vb lecture notesVb lecture notes
Vb lecture notes
 
Color model
Color modelColor model
Color model
 
Computer graphics circle
Computer graphics   circleComputer graphics   circle
Computer graphics circle
 
Getstart graphic
Getstart graphicGetstart graphic
Getstart graphic
 
Image types,raster and vector graphics
Image types,raster and vector graphicsImage types,raster and vector graphics
Image types,raster and vector graphics
 
Graphics c
Graphics cGraphics c
Graphics c
 
Image types,raster and vector graphics
Image types,raster and vector graphicsImage types,raster and vector graphics
Image types,raster and vector graphics
 
Graphics display devices
Graphics display devicesGraphics display devices
Graphics display devices
 
Cg applications
Cg applicationsCg applications
Cg applications
 
Types of cards
Types of cardsTypes of cards
Types of cards
 
External types of hardware
External types of hardwareExternal types of hardware
External types of hardware
 
Devices of computer
Devices of computerDevices of computer
Devices of computer
 
Internal computer hardware
Internal computer hardwareInternal computer hardware
Internal computer hardware
 
Computer hardware
Computer hardwareComputer hardware
Computer hardware
 
Types of slots
Types of slotsTypes of slots
Types of slots
 
Application of computer graphic
Application of computer graphicApplication of computer graphic
Application of computer graphic
 
What is computer graphics
What is computer graphicsWhat is computer graphics
What is computer graphics
 
Types of rom
Types of romTypes of rom
Types of rom
 
Types of ram
Types of ramTypes of ram
Types of ram
 

Recently uploaded

ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxJiesonDelaCerna
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitolTechU
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxUnboundStockton
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...jaredbarbolino94
 

Recently uploaded (20)

ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptx
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptx
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docx
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...
 

Circles graphic

  • 1. Graphic mode Coordinate system Some graphic functions WHAT GRAPHICS ISWHAT GRAPHICS IS Exit Program Exp Explanation Introduction Exe file
  • 2. If we want to start graphics programming then we need two files which are GRAPHICS.H and GRAPHICS.LIB. The graphic mode functions require a graphics monitor and adapter card such as Color Graphics Adapter(CGA), Enhanced Graphics Adapter(EGA) and Video Graphics Array(VGA). GRAPHIC MODEGRAPHIC MODE Exit Program Exp Explanation Introduction Exe file
  • 3. Traditional XY coordinate system Graphics XY coordinate system XY Coordinate systemXY Coordinate system Exit Program Exp Explanation Introduction Exe file
  • 4. Traditional XY Coordinate systemTraditional XY Coordinate system  Coordinate system simply means that how to pinpoint any location on the screen as an XY value  We all should be well known of traditional XY coordinate system, which is commonly used in math. X-axis Y-axis (0,0) Exit Program Exp Explanation Introduction Exe file
  • 5. Graphics XY Coordinate systemGraphics XY Coordinate system  Graphics coordinate systems typically spell out the origin of the system.  The graphics coordinate system has an origin that is located in the upper-left corner of the window, with +ve X values increasing to the right and +ve Y values increasing down. X-axis Y-axis (0,0) Exit Program Exp Explanation Introduction Exe file
  • 6.  In computer the graphics XY coordinate system is similar to math coordinate system except it applies to the client area of windows.  Client area is the area, which doesn't include the title bar, scrollbars, and so on.  All values in the Graphics coordinate system are positive integers. Exit Program Exp Explanation Introduction Exe file
  • 7. rectangle() circle() closegraph() Some graphic functionsSome graphic functions Exit Program Exp Explanation Introduction Exe file
  • 8.  rectangle (left,top,right,bottom) : This function draws a rectangle with (left,top) as upper left of the rectangle & (right,bottom) as its lower right of the corner. Exit Program Exp Explanation Introduction Exe file
  • 9. Circle( ): Circle function takes X and Y values with respect to top left corner of the screen and third co- ordinate is nothing but radius of circle.. Exit Program Exp Explanation Introduction Exe file
  • 10. Closegraph( ) : The closegraph() swithces back the screen from grpahics mode to text mode. If you don’t use this function then you may have undesirable effects.Here this function is called after the getch() function as screen shouldn’t switch to text mode till user hits any key. getch( ) : getch( ) function gets a character from console but does not echo it on screen.This is used to pause the screen till user hits any key. Exit Program Exp Explanation Introduction Exe file
  • 11. Library files Class Functions Main Program ExplanationProgram Explanation Exit Program Exp Explanation Introduction Exe file
  • 13. HEADER “Headers" are libraries of code you may insert in your program by including them by reference in the top block. Exit Program Exp Explanation Introduction Exe file
  • 14. #include<iostream.h>  Declares objects that control reading and writing to the standard streams. This is often the only header you need to include to perform input and output from a C++ program.  cerr  cin  cout  wcerr  wcin  wcout Exit Program Exp Explanation Introduction Exe file
  • 15. #include<conio.h> Function Description kbhit Determines if a keyboard key was pressed. ungetch Puts a character back into the keyboard buffer. putch Writes a character directly to the console. cgets Gets a string directly from the console. cprintf Formats and prints a string directly to the console. cputs Outputs a string directly to the console. cscanf Reads and formats values directly from the console. Exit Program Exp Explanation Introduction Exe file
  • 16. #include<stdlib.h> The name "stdlib" stands for standard library. stdlib.h includes functions involving memory allocation, process control, conversions and others. Exit Program Exp Explanation Introduction Exe file
  • 17. #include<graphics.h> This file contains definitions and explanation of all the graphic functions and constants. Here we are dealing with graphic mode function. To switch from text mode to graphic mode, we have function called as ” initgraph ” . Exit Program Exp Explanation Introduction Exe file
  • 18. Variables: x, y, xv, yv, r Constructor: cirl(); Functions: Move(); cc(); cdx(); cdy(); Class of circleClass of circle Exit Program Exp Explanation Introduction Exe file
  • 19. CLASS class circl { private: int col,r; public: int xv, yv; int x, y; Exit Program Exp Explanation Introduction Exe file
  • 20. circl() { x=getmaxx()/2; y=getmaxy()/2; col=1,r=2; } getmaxx: Returns the maximum value of x getmaxy: Returns the maximum value of y CONSTRUCTOR Exit Program Exp Explanation Introduction Exe file
  • 21. Color palettes  The graphics.h has declaration about 16 colors.In order to use the color in your program you have to use the functions like setcolor( ) ,setbkcolor( ) & setfillstyle( ).The function setcolor( ) sets the value of current drawing color to color  setfillstyle( ) sets the current fill pattern and fill color  setbkcolor( ) sets the value for background color,which is by default black Exit Program Exp Explanation Introduction Exe file
  • 22.  Color ValueBlack 0  Blue 1  GREEN 2  Cyan 3  RED 4  MAGENTA 5  BROWN 6  LIGHTGRAY 7  DARKGRAY 8  LIGHTBLUE 9  LIGHTGREEN 10  LIGHTCYAN 11  LIGHTRED 12  LIGHTMAGENTA 13  YELLOW 14  WHITE 15 Exit Program Exp Explanation Introduction Exe file
  • 23. Exit Program Exp Explanation Introduction Exe file Function void cc(void) /*change color { if(col==15) { col=0; } col++; }
  • 24. EXPLANATION  IF THE COLOR VALUE IS EQUAL TO 15 WHICH IS THE LAST COLOR VALUE THEN WE SHOULD SET COLOR VALUE “1”  HERE IN PROGRAM IS COL=0; IT MEANS THAT ,HERE COLOR BECOME BLACK WHICH WOULD BE INVISIBLE SO WE SHOULD INCREASE COLOR BY ONE,THAT SHOULD BE VISIBLE Exit Program Exp Explanation Introduction Exe file
  • 25. Functions to move balls void move(void) { setcolor(0); circle(x,y,r); x=x+xv; y=y+yv; setcolor(col); circle(x,y,r); } 0 for BLACK Exit Program Exp Explanation Introduction Exe file
  • 26. Making 8 circles in main circl p[8]; p[0].xv=1; p[0].yv=0; p[1].xv=-1; p[1].yv=0; p[2].xv=0; p[2].yv=-1; p[3].xv=0; p[3].yv=1; X(320) Y(240) If monitor has a resolution of 640*480. x=x+xv; y=y+yv; Exit Program Exp Explanation Introduction Exe file
  • 27. p[4].xv=1; p[4].yv=-1; p[5].xv=1; p[5].yv=1; p[6].xv=-1; p[6].yv=-1; p[7].xv=-1; p[7].yv=1; X(320) Y(240) If monitor has a resolution of 640*480. x=x+xv; y=y+yv; Exit Program Exp Explanation Introduction Exe file
  • 28. Function for changing the direction of a ballFunction for changing the direction of a ball ((x-axis)) inline void cdx(void) { xv=xv*-1; cc(); } X(320) Y(240) Exit Program Exp Explanation Introduction Exe file
  • 29. inline void cdy(void) { yv=yv*-1; cc(); } Function for changing the direction of a ballFunction for changing the direction of a ball ((y-axis)) X(320) Y(240)Exit Program Exp Explanation Introduction Exe file
  • 30. Eight object of circles MainMain Exit Program Exp Explanation Introduction Exe file
  • 31. void main(void) { clrscr(); int driver=DETECT,mode; initgraph(&driver,&mode); int l=100,t=100,r=540,b=380; int temp,num; Exit Program Exp Explanation Introduction Exe file
  • 32. initgraph(&driver,&mode);  This function selects the best resolution and direct that value to variable mode  The two int variables driver, mode are graphic driver and graphic mode respectively.  The mode handles value that tells us which resolution and monitor we are using  The driver specifies the graphic driver to be used. Three types of drivers are CGA, VGA, EGA Exit Program Exp Explanation Introduction Exe file
  • 33. for(num=0; num<=200; num++) { putpixel(random(640),(random(480)),4); } setcolor(5); for(num=0;num<=500;num++) { putpixel(100+random(435),100+(random(275)),num); } Description: putpixel plots a point in the color defined by color at (x,y) Exit Program Exp Explanation Introduction Exe file void putpixel(int x, int y, int color);
  • 34. random Declaration: int random(int num); Remarks: random returns a random number between 0 and num-1. Exit Program Exp Explanation Introduction Exe file
  • 35. setcolor(5); Definition: setcolor sets the current drawing color Declaration: void setcolor(int color); Remarks: setcolor sets the current drawing color to color Exit Program Exp Explanation Introduction Exe file
  • 36. program  rectangle(10,10,80,80);  Outtextxy (15,45,"pause=1");  rectangle(100,10,170,80);  outtextxy(105,45, ‘’ quit=2"); Exit Program Exp Explanation Introduction Exe file
  • 37. do { delay(5); num=0; while(num<=7) { If (p[num].x >=l&&p[num].x<=r&&p[num].y>=t&&p[num].y<=b) { p[num].move(); } if (p[num].x<=l||p[num].x>=r) { p[num].cdx(); rectangle(100-3,100-3,540+3,280+3) } if (p[num].y<=t||p[num].y>=b) { p[num].cdy(); rectangle(100-3,100-3,540+3,380+3) } . . Exit Program Exp Explanation Introduction Exe file
  • 38. EXPLANATION  If our circle exceed from the left side and behind the right side of rectangle also below from the top and above from the bottom, means the circle is inside the rectangle then we will move the function by calling (“move()”) function. Exit Program Exp Explanation Introduction Exe file
  • 39.  If our circle is exceed from the right side or behind the left side, then we have to change the x-direction of circle.  If our circle is above the top or below the bottom of the rectangle then we have to change the y-direction of circle. Exit Program Exp Explanation Introduction Exe file
  • 41. closegraph(); Definition: Shuts down the graphics system Declaration: void closegraph(void); Remarks: closegraph deallocates all memory allocated by the graphics system. Exit Program Exp Explanation Introduction Exe file
  • 42. cleardevice(); Definition: Clears the graphics screen Declaration: void cleardevice(void); Remarks: cleardevice erases the entire graphics screen and moves the CP (current position) to home (0,0). Exit Program Exp Explanation Introduction Exe file