SlideShare une entreprise Scribd logo
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
 
Study on Fundamentals of Raster Scan Graphics
Study on Fundamentals of Raster Scan GraphicsStudy on Fundamentals of Raster Scan Graphics
Study on Fundamentals of Raster Scan Graphics
 
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
 

Dernier

Dernier (20)

Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024
 
A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyA Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System Strategy
 
AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
 
ECS 2024 Teams Premium - Pretty Secure
ECS 2024   Teams Premium - Pretty SecureECS 2024   Teams Premium - Pretty Secure
ECS 2024 Teams Premium - Pretty Secure
 
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1
 
Server-Driven User Interface (SDUI) at Priceline
Server-Driven User Interface (SDUI) at PricelineServer-Driven User Interface (SDUI) at Priceline
Server-Driven User Interface (SDUI) at Priceline
 
Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara Laskowska
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
Designing for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastDesigning for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at Comcast
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
 
Enterprise Security Monitoring, And Log Management.
Enterprise Security Monitoring, And Log Management.Enterprise Security Monitoring, And Log Management.
Enterprise Security Monitoring, And Log Management.
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Strategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering TeamsStrategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering Teams
 
Agentic RAG What it is its types applications and implementation.pdf
Agentic RAG What it is its types applications and implementation.pdfAgentic RAG What it is its types applications and implementation.pdf
Agentic RAG What it is its types applications and implementation.pdf
 

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-: