SlideShare une entreprise Scribd logo
1  sur  12
Graphics Programing
1. The Graphics class
2. The Color class
3. The Font class
4. The FontMetrics class
5. The Dimension class
1. Method of Graphics class
A) drawLine():
-:Draw line method used to draw a line.
-:This method draw line joninig the points
(x1,y1) and (x2,y2).
Syn: void drawLine(int x1,int y1,int x,int y2);
Ex: g.drawLine(20,30,80,100);
O/P-:
B) drawString():
-:The msg is displayed at the spcified location spcified
by the x and y co-ordinates.
Syn-: void drawString(String msg,int x,int y);
EX-: g.drawString(“JSN”,10,40);
O/P-: JSN
C) drawRect():
-:This method draws a rectangle from the upper-left corner
at the point (x,y)of the width and height specified by
which and height.
Syn-: void drawRect(int x,int y,int width,int height
Ex-: g.drawRect(120,60,100,50);
O/p-:
D) fillRect():
-: It draws and fill the rectangle with color.
Syn-: void fillRect(int x,int y,int w,int h);
EX-: g.fillRect(120,60,100,50);
O/P-:
E) drawRoundRect():
-:This method are used to draw a Round Rectangle.
Syn-: void drawRoundRect(int x,int y,int w,int h,
int xdia,int ydia);
EX-:g.drawRoundRect(120,60,100,50,100,50);
O/P-:
F) fillRoundRect():
-:It draws and fill the roundrectangle with the
color.
Syn-: void fillRoundRect(int x,int y,int w,int h,
int xdia,int ydia);
EX-: g.drawRoundRect(120,60,100,50,100,50);
O/P-:
G) drawOval():
-: This methods draws an oval.The oval is drawn within
the bounding rectangle.
Syn-: void drawOval(int x,int y,int width,int height);
EX-:g.drawOval(120,180,100,50);
O/P-:
H) fillOval():
-:It draws and fills the oval with Color.
Syn-: void fillOval(int x,int y,int width,int height);
EX-: g.fillOval(120,240,75,75);
O/P-:
I) drawPolygon():
-:This method is used to draw a polygon of num of
points angles.
Syn-: void drawPolygon(int x[ ],int y[ ],int n);
EX-:int x[ ]={170,220,220,120,120};
g.drawPolygon(x,y,5);
int y[ ]={380,430,480,480,430};
O/P-:
J) fillPolygon():
-: It draws and fills the polygon with color.
Syn-: void fillPolygon(int x[ ],int y[ ],int n);
EX-:int x[ ]={170,220,220,120,120};
int y[ ]={380,430,480,480,430};
g.fillPolygon(x,y,5);
O/P-:
Thank You
Jay Swaminarayan

Contenu connexe

Tendances (20)

3.3 graphs of exponential functions
3.3 graphs of  exponential functions3.3 graphs of  exponential functions
3.3 graphs of exponential functions
 
Yocco41
Yocco41Yocco41
Yocco41
 
Polynomial Functions
Polynomial FunctionsPolynomial Functions
Polynomial Functions
 
Matlab introduction
Matlab introductionMatlab introduction
Matlab introduction
 
Notes on 3.2 properties of linear frunction graphs
Notes on 3.2   properties of linear frunction graphsNotes on 3.2   properties of linear frunction graphs
Notes on 3.2 properties of linear frunction graphs
 
Linear equations part i
Linear equations part iLinear equations part i
Linear equations part i
 
2 5 writing eqns in slope-intercept form
2 5 writing eqns in slope-intercept form2 5 writing eqns in slope-intercept form
2 5 writing eqns in slope-intercept form
 
2.2 linear equations
2.2 linear equations2.2 linear equations
2.2 linear equations
 
Annexure i
Annexure  iAnnexure  i
Annexure i
 
Graphing Linear Functions
Graphing Linear FunctionsGraphing Linear Functions
Graphing Linear Functions
 
2.5
2.52.5
2.5
 
Graphing lines
Graphing linesGraphing lines
Graphing lines
 
Graphing lines
Graphing linesGraphing lines
Graphing lines
 
Day 5 examples u5w14
Day 5 examples u5w14Day 5 examples u5w14
Day 5 examples u5w14
 
Graphing Linear Equations Teacher Lecture
Graphing Linear Equations Teacher LectureGraphing Linear Equations Teacher Lecture
Graphing Linear Equations Teacher Lecture
 
Exercise #19
Exercise #19Exercise #19
Exercise #19
 
Calc 1.2a
Calc 1.2aCalc 1.2a
Calc 1.2a
 
Graphs of linear equation
Graphs of linear equationGraphs of linear equation
Graphs of linear equation
 
Moving Straight Ahead 2.3
Moving Straight Ahead 2.3Moving Straight Ahead 2.3
Moving Straight Ahead 2.3
 
K10765 Matlab 3D Mesh Plots
K10765 Matlab 3D Mesh PlotsK10765 Matlab 3D Mesh Plots
K10765 Matlab 3D Mesh Plots
 

En vedette (6)

Chirantan (or)
Chirantan  (or)Chirantan  (or)
Chirantan (or)
 
Academic English Skills: Introduction to Academic Writing Skills
Academic English Skills: Introduction to Academic Writing SkillsAcademic English Skills: Introduction to Academic Writing Skills
Academic English Skills: Introduction to Academic Writing Skills
 
Introduction to Technical Writing
Introduction to Technical WritingIntroduction to Technical Writing
Introduction to Technical Writing
 
ENG 131: Technical Writing Introduction PowerPoint
ENG 131: Technical Writing Introduction PowerPointENG 131: Technical Writing Introduction PowerPoint
ENG 131: Technical Writing Introduction PowerPoint
 
Types of academic writing
Types of academic writingTypes of academic writing
Types of academic writing
 
Technical Writing
Technical WritingTechnical Writing
Technical Writing
 

Similaire à Chirantan (java)

Open GL T0074 56 sm1
Open GL T0074 56 sm1Open GL T0074 56 sm1
Open GL T0074 56 sm1
Roziq Bahtiar
 
Line drawing algo.
Line drawing algo.Line drawing algo.
Line drawing algo.
Mohd Arif
 
Output Primitives in Computer Graphics and Multimedia
Output Primitives in Computer Graphics and MultimediaOutput Primitives in Computer Graphics and Multimedia
Output Primitives in Computer Graphics and Multimedia
saranyan75
 
Computer Graphics and Multimedia Output primitives
Computer Graphics and Multimedia Output primitivesComputer Graphics and Multimedia Output primitives
Computer Graphics and Multimedia Output primitives
saranyan75
 
Lectures r-graphics
Lectures r-graphicsLectures r-graphics
Lectures r-graphics
etyca
 

Similaire à Chirantan (java) (20)

Basic Graphics in Java
Basic Graphics in JavaBasic Graphics in Java
Basic Graphics in Java
 
raster algorithm.pdf
raster algorithm.pdfraster algorithm.pdf
raster algorithm.pdf
 
elementry-objects-CG give great effort on learning for exam
elementry-objects-CG give great effort on learning for examelementry-objects-CG give great effort on learning for exam
elementry-objects-CG give great effort on learning for exam
 
OUTPUT PRIMITIVES.pptx
OUTPUT PRIMITIVES.pptxOUTPUT PRIMITIVES.pptx
OUTPUT PRIMITIVES.pptx
 
OUTPUT PRIMITIVES.pptx
OUTPUT PRIMITIVES.pptxOUTPUT PRIMITIVES.pptx
OUTPUT PRIMITIVES.pptx
 
Open GL T0074 56 sm1
Open GL T0074 56 sm1Open GL T0074 56 sm1
Open GL T0074 56 sm1
 
99995320.ppt
99995320.ppt99995320.ppt
99995320.ppt
 
Computer graphics lab manual
Computer graphics lab manualComputer graphics lab manual
Computer graphics lab manual
 
Computer Graphics Unit 2
Computer Graphics Unit 2Computer Graphics Unit 2
Computer Graphics Unit 2
 
lect.no.3.pptx
lect.no.3.pptxlect.no.3.pptx
lect.no.3.pptx
 
Computer graphics notes 2 tutorials duniya
Computer graphics notes 2   tutorials duniyaComputer graphics notes 2   tutorials duniya
Computer graphics notes 2 tutorials duniya
 
Programming with matlab session 6
Programming with matlab session 6Programming with matlab session 6
Programming with matlab session 6
 
Line drawing algo.
Line drawing algo.Line drawing algo.
Line drawing algo.
 
Computer Graphics Unit 1
Computer Graphics Unit 1Computer Graphics Unit 1
Computer Graphics Unit 1
 
Matlab plotting
Matlab plottingMatlab plotting
Matlab plotting
 
Output Primitives in Computer Graphics and Multimedia
Output Primitives in Computer Graphics and MultimediaOutput Primitives in Computer Graphics and Multimedia
Output Primitives in Computer Graphics and Multimedia
 
Computer Graphics and Multimedia Output primitives
Computer Graphics and Multimedia Output primitivesComputer Graphics and Multimedia Output primitives
Computer Graphics and Multimedia Output primitives
 
Lectures r-graphics
Lectures r-graphicsLectures r-graphics
Lectures r-graphics
 
paper
paperpaper
paper
 
2D array
2D array2D array
2D array
 

Dernier

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Dernier (20)

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 

Chirantan (java)

  • 1. Graphics Programing 1. The Graphics class 2. The Color class 3. The Font class 4. The FontMetrics class 5. The Dimension class
  • 2. 1. Method of Graphics class A) drawLine(): -:Draw line method used to draw a line. -:This method draw line joninig the points (x1,y1) and (x2,y2). Syn: void drawLine(int x1,int y1,int x,int y2); Ex: g.drawLine(20,30,80,100); O/P-:
  • 3. B) drawString(): -:The msg is displayed at the spcified location spcified by the x and y co-ordinates. Syn-: void drawString(String msg,int x,int y); EX-: g.drawString(“JSN”,10,40); O/P-: JSN
  • 4. C) drawRect(): -:This method draws a rectangle from the upper-left corner at the point (x,y)of the width and height specified by which and height. Syn-: void drawRect(int x,int y,int width,int height Ex-: g.drawRect(120,60,100,50); O/p-:
  • 5. D) fillRect(): -: It draws and fill the rectangle with color. Syn-: void fillRect(int x,int y,int w,int h); EX-: g.fillRect(120,60,100,50); O/P-:
  • 6. E) drawRoundRect(): -:This method are used to draw a Round Rectangle. Syn-: void drawRoundRect(int x,int y,int w,int h, int xdia,int ydia); EX-:g.drawRoundRect(120,60,100,50,100,50); O/P-:
  • 7. F) fillRoundRect(): -:It draws and fill the roundrectangle with the color. Syn-: void fillRoundRect(int x,int y,int w,int h, int xdia,int ydia); EX-: g.drawRoundRect(120,60,100,50,100,50); O/P-:
  • 8. G) drawOval(): -: This methods draws an oval.The oval is drawn within the bounding rectangle. Syn-: void drawOval(int x,int y,int width,int height); EX-:g.drawOval(120,180,100,50); O/P-:
  • 9. H) fillOval(): -:It draws and fills the oval with Color. Syn-: void fillOval(int x,int y,int width,int height); EX-: g.fillOval(120,240,75,75); O/P-:
  • 10. I) drawPolygon(): -:This method is used to draw a polygon of num of points angles. Syn-: void drawPolygon(int x[ ],int y[ ],int n); EX-:int x[ ]={170,220,220,120,120}; g.drawPolygon(x,y,5); int y[ ]={380,430,480,480,430}; O/P-:
  • 11. J) fillPolygon(): -: It draws and fills the polygon with color. Syn-: void fillPolygon(int x[ ],int y[ ],int n); EX-:int x[ ]={170,220,220,120,120}; int y[ ]={380,430,480,480,430}; g.fillPolygon(x,y,5); O/P-: