SlideShare a Scribd company logo
1 of 21
Introduction to Graphics
Introduction
• There are two modes of output device:
– Text Mode
– Graphics Mode
Graphics Characteristics
• Pixels
• Resolutions
• Colors
• Video Adapters
Initializing Graphics Mode
• We use initgraph() function
• Syntax:
– Intigraph(&graphics_driver,&graphics_mode,Path
_to_driver);
Closing Graphics Mode
• Function closegraph() is used.
• Syntax:
– closegraph();
Sample Program
Error Handling
• graphresult() function is used to check if
certain graphics operation succeeded or not.
• It return 0 for no error.
Some Functions in Graphics
• putpixel() and getpixel()
• setcolor() and setbcolor()
• line()
• circle()
• ellipse
• rectangle()
• settextstyle() and outtext()
• getmaxx() and getmaxy()
putpixel() and getpixel()
• Syntax:
– int getpixel(int x, int y);
– void putpixel(int x, int y, int color);
• getpixel returns the color of pixel present at
point(x, y).
• putpixel plots a pixel at a point(x, y) of
specified color.
setbcolor()
• Syntax :-
– void setbkcolor(int color);
• setbkcolor function changes current
background color e.g. setbkcolor(YELLLOW)
changes the current background color to
YELLOW.
• Remember that default drawing color is
WHITE and background color is BLACK.
setcolor()
• Syntax :-
– void setcolor(int color);
• setcolor function changes current drawing
color e.g. setcolor(YELLLOW) changes the
current drawing color to YELLOW.
line()
• line function is used to draw a line from a
point(x1,y1) to point(x2,y2)
• Syntax :-
– void line(int x1, int y1, int x2, int y2);
circle()
• Syntax :-
– void circle(int x, int y, int radius);
• Circle function is used to draw a circle with
center (x,y) and third parameter specifies the
radius of the circle.
ellipse()
• Syntax :-
– void ellipse(int x, int y, int stangle, int endangle, int
xradius, int yradius);
• Ellipse is used to draw an ellipse (x,y) are
coordinates of center of the ellipse, stangle is
the starting angle, end angle is the ending
angle, and fifth and sixth parameters specifies
the X and Y radius of the ellipse.
rectangle()
• Syntax:-
– void rectangle(int left, int top, int right, int
bottom);
• Coordinates of left top and right bottom
corner are required to draw the rectangle.
settextstyle()
• Syntax :-
– void settextstyle( int font, int direction, int
charsize);
• font argument specifies the font of text,
Direction can be HORIZ_DIR (Left to right) or
VERT_DIR (Bottom to top).
outtext()
• outtext function displays text at current
position.
• Syntax :-
– void outtext(char *string);
getmaxx() and getmaxy()
• getmaxx function returns the maximum X
coordinate for current graphics mode and
driver.
• Declaration :- int getmaxx();
• getmaxy function returns the maximum Y
coordinate for current graphics mode and
driver.
• Declaration :- int getmaxy();
Graphics in C programming
Graphics in C programming

More Related Content

What's hot

Attributes of Output Primitives
Attributes of Output PrimitivesAttributes of Output Primitives
Attributes of Output PrimitivesRenita Santhmayora
 
Video display devices
Video display devicesVideo display devices
Video display devicesMohd Arif
 
Computer graphics notes
Computer graphics notesComputer graphics notes
Computer graphics notessmruti sarangi
 
2 d geometric transformations
2 d geometric transformations2 d geometric transformations
2 d geometric transformationsMohd Arif
 
Visible surface detection in computer graphic
Visible surface detection in computer graphicVisible surface detection in computer graphic
Visible surface detection in computer graphicanku2266
 
Cyrus beck line clipping algorithm
Cyrus beck line clipping algorithmCyrus beck line clipping algorithm
Cyrus beck line clipping algorithmPooja Dixit
 
Graphics software and standards
Graphics software and standardsGraphics software and standards
Graphics software and standardsMani Kanth
 
Seed filling algorithm
Seed filling algorithmSeed filling algorithm
Seed filling algorithmMani Kanth
 
Multimedia software tools
Multimedia software toolsMultimedia software tools
Multimedia software toolsJay Patel
 
Output primitives in Computer Graphics
Output primitives in Computer GraphicsOutput primitives in Computer Graphics
Output primitives in Computer GraphicsKamal Acharya
 
Character generation techniques
Character generation techniquesCharacter generation techniques
Character generation techniquesMani Kanth
 
line attributes.pptx
line attributes.pptxline attributes.pptx
line attributes.pptxRubaNagarajan
 
Chapter 3 : IMAGE
Chapter 3 : IMAGEChapter 3 : IMAGE
Chapter 3 : IMAGEazira96
 
3D transformation in computer graphics
3D transformation in computer graphics3D transformation in computer graphics
3D transformation in computer graphicsSHIVANI SONI
 
what is Font in multimedia
 what is Font in multimedia what is Font in multimedia
what is Font in multimediamaliksiddique1
 
Raster animation
Raster animationRaster animation
Raster animationabhijit754
 

What's hot (20)

Unit 11. Graphics
Unit 11. GraphicsUnit 11. Graphics
Unit 11. Graphics
 
Attributes of Output Primitives
Attributes of Output PrimitivesAttributes of Output Primitives
Attributes of Output Primitives
 
Video display devices
Video display devicesVideo display devices
Video display devices
 
Computer graphics notes
Computer graphics notesComputer graphics notes
Computer graphics notes
 
2 d geometric transformations
2 d geometric transformations2 d geometric transformations
2 d geometric transformations
 
UNIT-IV
UNIT-IVUNIT-IV
UNIT-IV
 
Visible surface detection in computer graphic
Visible surface detection in computer graphicVisible surface detection in computer graphic
Visible surface detection in computer graphic
 
Cyrus beck line clipping algorithm
Cyrus beck line clipping algorithmCyrus beck line clipping algorithm
Cyrus beck line clipping algorithm
 
Graphics software and standards
Graphics software and standardsGraphics software and standards
Graphics software and standards
 
Seed filling algorithm
Seed filling algorithmSeed filling algorithm
Seed filling algorithm
 
Multimedia software tools
Multimedia software toolsMultimedia software tools
Multimedia software tools
 
Output primitives in Computer Graphics
Output primitives in Computer GraphicsOutput primitives in Computer Graphics
Output primitives in Computer Graphics
 
Character generation techniques
Character generation techniquesCharacter generation techniques
Character generation techniques
 
line attributes.pptx
line attributes.pptxline attributes.pptx
line attributes.pptx
 
Introduction to 2D/3D Graphics
Introduction to 2D/3D GraphicsIntroduction to 2D/3D Graphics
Introduction to 2D/3D Graphics
 
Chapter 3 : IMAGE
Chapter 3 : IMAGEChapter 3 : IMAGE
Chapter 3 : IMAGE
 
3D transformation in computer graphics
3D transformation in computer graphics3D transformation in computer graphics
3D transformation in computer graphics
 
Curves and surfaces
Curves and surfacesCurves and surfaces
Curves and surfaces
 
what is Font in multimedia
 what is Font in multimedia what is Font in multimedia
what is Font in multimedia
 
Raster animation
Raster animationRaster animation
Raster animation
 

Viewers also liked

Computer Graphics Practical
Computer Graphics PracticalComputer Graphics Practical
Computer Graphics PracticalNeha Sharma
 
C Graphics Functions
C Graphics FunctionsC Graphics Functions
C Graphics FunctionsSHAKOOR AB
 
Computer Graphics Applications
Computer Graphics ApplicationsComputer Graphics Applications
Computer Graphics ApplicationsSaravana Priya
 
Basics of Computer graphics lab
Basics of Computer graphics labBasics of Computer graphics lab
Basics of Computer graphics labPriya Goyal
 
Lecture on graphics
Lecture on graphicsLecture on graphics
Lecture on graphicsRafi_Dar
 
Introduction to computer graphics
Introduction to computer graphicsIntroduction to computer graphics
Introduction to computer graphicsKamal Acharya
 
computer graphics
computer graphicscomputer graphics
computer graphicsashpri156
 
Introduction to Computer graphics
Introduction to Computer graphics Introduction to Computer graphics
Introduction to Computer graphics PrathimaBaliga
 
applications of computer graphics
applications of computer graphicsapplications of computer graphics
applications of computer graphicsAaina Katyal
 
WordPress for Beginners, the Missing Guide
WordPress for Beginners, the Missing GuideWordPress for Beginners, the Missing Guide
WordPress for Beginners, the Missing GuideWPBrix.com
 
WordPress A - Z for beginners
WordPress A - Z for beginnersWordPress A - Z for beginners
WordPress A - Z for beginnersFerdias Ramadoni
 
1 c – graphic designs
1 c – graphic designs1 c – graphic designs
1 c – graphic designsHaseeb Patel
 
Computer graphics
Computer graphicsComputer graphics
Computer graphicsamitsarda3
 
principle of oop’s in cpp
principle of oop’s in cppprinciple of oop’s in cpp
principle of oop’s in cppgourav kottawar
 

Viewers also liked (20)

Computer Graphics Practical
Computer Graphics PracticalComputer Graphics Practical
Computer Graphics Practical
 
Graphics in C++
Graphics in C++Graphics in C++
Graphics in C++
 
C Graphics Functions
C Graphics FunctionsC Graphics Functions
C Graphics Functions
 
Computer Graphics Applications
Computer Graphics ApplicationsComputer Graphics Applications
Computer Graphics Applications
 
Computer Graphics
Computer GraphicsComputer Graphics
Computer Graphics
 
Basics of Computer graphics lab
Basics of Computer graphics labBasics of Computer graphics lab
Basics of Computer graphics lab
 
Applications of computer graphics
Applications of computer graphicsApplications of computer graphics
Applications of computer graphics
 
Lecture on graphics
Lecture on graphicsLecture on graphics
Lecture on graphics
 
Introduction to computer graphics
Introduction to computer graphicsIntroduction to computer graphics
Introduction to computer graphics
 
computer graphics
computer graphicscomputer graphics
computer graphics
 
Introduction to Computer graphics
Introduction to Computer graphics Introduction to Computer graphics
Introduction to Computer graphics
 
applications of computer graphics
applications of computer graphicsapplications of computer graphics
applications of computer graphics
 
WordPress for Beginners, the Missing Guide
WordPress for Beginners, the Missing GuideWordPress for Beginners, the Missing Guide
WordPress for Beginners, the Missing Guide
 
WordPress A - Z for beginners
WordPress A - Z for beginnersWordPress A - Z for beginners
WordPress A - Z for beginners
 
1 c – graphic designs
1 c – graphic designs1 c – graphic designs
1 c – graphic designs
 
Computer graphics
Computer graphicsComputer graphics
Computer graphics
 
Parm
ParmParm
Parm
 
Array and string
Array and stringArray and string
Array and string
 
Bitwise operators
Bitwise operatorsBitwise operators
Bitwise operators
 
principle of oop’s in cpp
principle of oop’s in cppprinciple of oop’s in cpp
principle of oop’s in cpp
 

Similar to Graphics in C programming

Powerpointpresentation.c
Powerpointpresentation.cPowerpointpresentation.c
Powerpointpresentation.cMaqbool Ur Khan
 
Computer Graphics Unit 1
Computer Graphics Unit 1Computer Graphics Unit 1
Computer Graphics Unit 1aravindangc
 
Matlab intro
Matlab introMatlab intro
Matlab introfvijayami
 
Lecture 02 visualization and programming
Lecture 02   visualization and programmingLecture 02   visualization and programming
Lecture 02 visualization and programmingSmee Kaem Chann
 
Introduction to Coding
Introduction to CodingIntroduction to Coding
Introduction to CodingFabio506452
 
Efficient realization for geometric transformation of digital images in run l...
Efficient realization for geometric transformation of digital images in run l...Efficient realization for geometric transformation of digital images in run l...
Efficient realization for geometric transformation of digital images in run l...Shlomo Pongratz
 
Presentation: Plotting Systems in R
Presentation: Plotting Systems in RPresentation: Plotting Systems in R
Presentation: Plotting Systems in RIlya Zhbannikov
 
Chapter02 graphics-programming
Chapter02 graphics-programmingChapter02 graphics-programming
Chapter02 graphics-programmingMohammed Romi
 
DIGITAL_SIGNAL_AND_IMAGE_PROCESSING_USIN.pptx
DIGITAL_SIGNAL_AND_IMAGE_PROCESSING_USIN.pptxDIGITAL_SIGNAL_AND_IMAGE_PROCESSING_USIN.pptx
DIGITAL_SIGNAL_AND_IMAGE_PROCESSING_USIN.pptxMdMojnuMiah3
 
Image processing tool box.pptx
Image processing tool box.pptxImage processing tool box.pptx
Image processing tool box.pptxAvinashJain66
 
Computer graphics
Computer graphicsComputer graphics
Computer graphicssnelkoli
 
Lecture 9-online
Lecture 9-onlineLecture 9-online
Lecture 9-onlinelifebreath
 

Similar to Graphics in C programming (20)

Powerpointpresentation.c
Powerpointpresentation.cPowerpointpresentation.c
Powerpointpresentation.c
 
Cg lab cse-v (1) (1)
Cg lab cse-v (1) (1)Cg lab cse-v (1) (1)
Cg lab cse-v (1) (1)
 
Computer Graphics Unit 1
Computer Graphics Unit 1Computer Graphics Unit 1
Computer Graphics Unit 1
 
Matlab intro
Matlab introMatlab intro
Matlab intro
 
Lecture 02 visualization and programming
Lecture 02   visualization and programmingLecture 02   visualization and programming
Lecture 02 visualization and programming
 
10 linescan
10 linescan10 linescan
10 linescan
 
Primitives
PrimitivesPrimitives
Primitives
 
Introduction to Coding
Introduction to CodingIntroduction to Coding
Introduction to Coding
 
Efficient realization for geometric transformation of digital images in run l...
Efficient realization for geometric transformation of digital images in run l...Efficient realization for geometric transformation of digital images in run l...
Efficient realization for geometric transformation of digital images in run l...
 
Lec2
Lec2Lec2
Lec2
 
Presentation: Plotting Systems in R
Presentation: Plotting Systems in RPresentation: Plotting Systems in R
Presentation: Plotting Systems in R
 
Chapter02 graphics-programming
Chapter02 graphics-programmingChapter02 graphics-programming
Chapter02 graphics-programming
 
DIGITAL_SIGNAL_AND_IMAGE_PROCESSING_USIN.pptx
DIGITAL_SIGNAL_AND_IMAGE_PROCESSING_USIN.pptxDIGITAL_SIGNAL_AND_IMAGE_PROCESSING_USIN.pptx
DIGITAL_SIGNAL_AND_IMAGE_PROCESSING_USIN.pptx
 
CG-Lecture3.pptx
CG-Lecture3.pptxCG-Lecture3.pptx
CG-Lecture3.pptx
 
september11.ppt
september11.pptseptember11.ppt
september11.ppt
 
Image processing tool box.pptx
Image processing tool box.pptxImage processing tool box.pptx
Image processing tool box.pptx
 
Computer graphics
Computer graphicsComputer graphics
Computer graphics
 
MATLAB & Image Processing
MATLAB & Image ProcessingMATLAB & Image Processing
MATLAB & Image Processing
 
raster algorithm.pdf
raster algorithm.pdfraster algorithm.pdf
raster algorithm.pdf
 
Lecture 9-online
Lecture 9-onlineLecture 9-online
Lecture 9-online
 

More from Kamal Acharya

Programming the basic computer
Programming the basic computerProgramming the basic computer
Programming the basic computerKamal Acharya
 
Introduction to Computer Security
Introduction to Computer SecurityIntroduction to Computer Security
Introduction to Computer SecurityKamal Acharya
 
Making decision and repeating in PHP
Making decision and repeating  in PHPMaking decision and repeating  in PHP
Making decision and repeating in PHPKamal Acharya
 
Working with arrays in php
Working with arrays in phpWorking with arrays in php
Working with arrays in phpKamal Acharya
 
Text and Numbers (Data Types)in PHP
Text and Numbers (Data Types)in PHPText and Numbers (Data Types)in PHP
Text and Numbers (Data Types)in PHPKamal Acharya
 
Capacity Planning of Data Warehousing
Capacity Planning of Data WarehousingCapacity Planning of Data Warehousing
Capacity Planning of Data WarehousingKamal Acharya
 
Information Privacy and Data Mining
Information Privacy and Data MiningInformation Privacy and Data Mining
Information Privacy and Data MiningKamal Acharya
 
Association Analysis in Data Mining
Association Analysis in Data MiningAssociation Analysis in Data Mining
Association Analysis in Data MiningKamal Acharya
 
Classification techniques in data mining
Classification techniques in data miningClassification techniques in data mining
Classification techniques in data miningKamal Acharya
 
Introduction to Data Mining and Data Warehousing
Introduction to Data Mining and Data WarehousingIntroduction to Data Mining and Data Warehousing
Introduction to Data Mining and Data WarehousingKamal Acharya
 

More from Kamal Acharya (20)

Programming the basic computer
Programming the basic computerProgramming the basic computer
Programming the basic computer
 
Computer Arithmetic
Computer ArithmeticComputer Arithmetic
Computer Arithmetic
 
Introduction to Computer Security
Introduction to Computer SecurityIntroduction to Computer Security
Introduction to Computer Security
 
Session and Cookies
Session and CookiesSession and Cookies
Session and Cookies
 
Functions in php
Functions in phpFunctions in php
Functions in php
 
Web forms in php
Web forms in phpWeb forms in php
Web forms in php
 
Making decision and repeating in PHP
Making decision and repeating  in PHPMaking decision and repeating  in PHP
Making decision and repeating in PHP
 
Working with arrays in php
Working with arrays in phpWorking with arrays in php
Working with arrays in php
 
Text and Numbers (Data Types)in PHP
Text and Numbers (Data Types)in PHPText and Numbers (Data Types)in PHP
Text and Numbers (Data Types)in PHP
 
Introduction to PHP
Introduction to PHPIntroduction to PHP
Introduction to PHP
 
Capacity Planning of Data Warehousing
Capacity Planning of Data WarehousingCapacity Planning of Data Warehousing
Capacity Planning of Data Warehousing
 
Data Warehousing
Data WarehousingData Warehousing
Data Warehousing
 
Search Engines
Search EnginesSearch Engines
Search Engines
 
Web Mining
Web MiningWeb Mining
Web Mining
 
Information Privacy and Data Mining
Information Privacy and Data MiningInformation Privacy and Data Mining
Information Privacy and Data Mining
 
Cluster Analysis
Cluster AnalysisCluster Analysis
Cluster Analysis
 
Association Analysis in Data Mining
Association Analysis in Data MiningAssociation Analysis in Data Mining
Association Analysis in Data Mining
 
Classification techniques in data mining
Classification techniques in data miningClassification techniques in data mining
Classification techniques in data mining
 
Data Preprocessing
Data PreprocessingData Preprocessing
Data Preprocessing
 
Introduction to Data Mining and Data Warehousing
Introduction to Data Mining and Data WarehousingIntroduction to Data Mining and Data Warehousing
Introduction to Data Mining and Data Warehousing
 

Recently uploaded

How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxPooja Bhuva
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...Nguyen Thanh Tu Collection
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxannathomasp01
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...Amil baba
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxDr. Ravikiran H M Gowda
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17Celine George
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsKarakKing
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxPooja Bhuva
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfDr Vijay Vishwakarma
 

Recently uploaded (20)

How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 

Graphics in C programming

  • 2. Introduction • There are two modes of output device: – Text Mode – Graphics Mode
  • 3. Graphics Characteristics • Pixels • Resolutions • Colors • Video Adapters
  • 4. Initializing Graphics Mode • We use initgraph() function • Syntax: – Intigraph(&graphics_driver,&graphics_mode,Path _to_driver);
  • 5. Closing Graphics Mode • Function closegraph() is used. • Syntax: – closegraph();
  • 7. Error Handling • graphresult() function is used to check if certain graphics operation succeeded or not. • It return 0 for no error.
  • 8.
  • 9. Some Functions in Graphics • putpixel() and getpixel() • setcolor() and setbcolor() • line() • circle() • ellipse • rectangle() • settextstyle() and outtext() • getmaxx() and getmaxy()
  • 10. putpixel() and getpixel() • Syntax: – int getpixel(int x, int y); – void putpixel(int x, int y, int color); • getpixel returns the color of pixel present at point(x, y). • putpixel plots a pixel at a point(x, y) of specified color.
  • 11. setbcolor() • Syntax :- – void setbkcolor(int color); • setbkcolor function changes current background color e.g. setbkcolor(YELLLOW) changes the current background color to YELLOW. • Remember that default drawing color is WHITE and background color is BLACK.
  • 12. setcolor() • Syntax :- – void setcolor(int color); • setcolor function changes current drawing color e.g. setcolor(YELLLOW) changes the current drawing color to YELLOW.
  • 13. line() • line function is used to draw a line from a point(x1,y1) to point(x2,y2) • Syntax :- – void line(int x1, int y1, int x2, int y2);
  • 14. circle() • Syntax :- – void circle(int x, int y, int radius); • Circle function is used to draw a circle with center (x,y) and third parameter specifies the radius of the circle.
  • 15. ellipse() • Syntax :- – void ellipse(int x, int y, int stangle, int endangle, int xradius, int yradius); • Ellipse is used to draw an ellipse (x,y) are coordinates of center of the ellipse, stangle is the starting angle, end angle is the ending angle, and fifth and sixth parameters specifies the X and Y radius of the ellipse.
  • 16. rectangle() • Syntax:- – void rectangle(int left, int top, int right, int bottom); • Coordinates of left top and right bottom corner are required to draw the rectangle.
  • 17. settextstyle() • Syntax :- – void settextstyle( int font, int direction, int charsize); • font argument specifies the font of text, Direction can be HORIZ_DIR (Left to right) or VERT_DIR (Bottom to top).
  • 18. outtext() • outtext function displays text at current position. • Syntax :- – void outtext(char *string);
  • 19. getmaxx() and getmaxy() • getmaxx function returns the maximum X coordinate for current graphics mode and driver. • Declaration :- int getmaxx(); • getmaxy function returns the maximum Y coordinate for current graphics mode and driver. • Declaration :- int getmaxy();