SlideShare a Scribd company logo
1 of 14
SVG standsforScalable VectorGraphicsand itis a language fordescribing2D-graphicsandgraphical
applicationsinXMLand
the XML isthenrenderedbyan SVGviewer.
SVG ismostlyuseful forvectortype diagramslike Piecharts,Two-dimensional graphsinanX,Y
coordinate systemetc.
SVG became a W3C Recommendation14.January2003
ViewingSVGFiles
Most of the webbrowserscandisplaySVGjustlike theycandisplayPNG,GIF,and JPG.
InternetExplorerusersmayhave toinstall the Adobe SVG Viewertobe able toview SVGinthe
browser.
EmbeddingSVGinHTML5
HTML5 allowsembeddingSVGdirectlyusing<svg>...</svg>tagwhichhas followingsimple syntax
<svg xmlns= "http://www.w3.org/2000/svg">
...
</svg>
HTML5 - SVGCircle
Followingisthe HTML5 versionof an SVGexample whichwoulddraw acircle using<circle>tag
<!DOCTYPE html>
<html>
<head>
<style>
#svgelem{
position:relative;
left:50%;
-webkit-transform:translateX(-20%);
-ms-transform:translateX(-20%);
transform:translateX(-20%);
}
</style>
<title>SVG</title>
<meta charset= "utf-8"/>
</head>
<body>
<h2 align= "center">HTML5 SVGCircle</h2>
<svg id= "svgelem"height="200" xmlns= "http://www.w3.org/2000/svg">
<circle id= "redcircle"cx = "50" cy = "50" r = "50" fill ="red"/>
</svg>
</body>
</html>
HTML5 - SVGRectangle
-----------------------------------------------------
<!DOCTYPE html>
<html>
<head>
<style>
#svgelem{
position:relative;
left:50%;
-webkit-transform:translateX(-50%);
-ms-transform:translateX(-50%);
transform:translateX(-50%);
}
</style>
<title>SVG</title>
<meta charset= "utf-8"/>
</head>
<body>
<h2 align= "center">HTML5 SVGRectangle</h2>
<svg id = "svgelem"height="200" xmlns="http://www.w3.org/2000/svg">
<rect id = "redrect"width= "300" height= "100" fill ="red"/>
</svg>
</body>
</html>
HTML5 - SVGLine
------------------------------------
<!DOCTYPE html>
<html>
<head>
<style>
#svgelem{
position:relative;
left:50%;
-webkit-transform:translateX(-50%);
-ms-transform:translateX(-50%);
transform:translateX(-50%);
}
</style>
<title>SVG</title>
<metacharset = "utf-8" />
</head>
<body>
<h2 align= "center">HTML5 SVG Line</h2>
<svg id= "svgelem"height="200" xmlns= "http://www.w3.org/2000/svg">
<line x1= "0" y1 = "0" x2 = "200" y2 = "100"
style = "stroke:red;stroke-width:2"/>
</svg>
</body>
</html>
HTML5 - SVGEllipse
------------------------------------------
<!DOCTYPE html>
<html>
<head>
<style>
#svgelem{
position:relative;
left:50%;
-webkit-transform:translateX(-40%);
-ms-transform:translateX(-40%);
transform:translateX(-40%);
}
</style>
<title>SVG</title>
<metacharset = "utf-8" />
</head>
<body>
<h2 align= "center">HTML5 SVG Ellipse</h2>
<svg id= "svgelem"height="200" xmlns= "http://www.w3.org/2000/svg">
<ellipse cx ="100" cy = "50" rx = "100" ry = "50" fill ="red"/>
</svg>
</body>
</html>
HTML5 - SVGPolygon
--------------------------------------------------
<!DOCTYPE html>
<html>
<head>
<style>
#svgelem{
position:relative;
left:50%;
-webkit-transform:translateX(-50%);
-ms-transform:translateX(-50%);
transform:translateX(-50%);
}
</style>
<title>SVG</title>
<metacharset = "utf-8" />
</head>
<body>
<h2 align= "center">HTML5 SVG Polygon</h2>
<svg id= "svgelem"height="200" xmlns= "http://www.w3.org/2000/svg">
<polygon points= "20,10 300,20, 170,50" fill = "red"/>
</svg>
</body>
</html>
HTML5 - SVGPolyline
-----------------------------------------------------
<!DOCTYPE html>
<html>
<head>
<style>
#svgelem{
position:relative;
left:50%;
-webkit-transform:translateX(-20%);
-ms-transform:translateX(-20%);
transform:translateX(-20%);
}
</style>
<title>SVG</title>
<metacharset = "utf-8" />
</head>
<body>
<h2 align= "center">HTML5 SVG Polyline</h2>
<svg id= "svgelem"height="200" xmlns= "http://www.w3.org/2000/svg">
<polyline points="0,0 0,20 20,20 20,40 40,40 40,60" fill ="red"/>
</svg>
</body>
</html>
HTML5 - SVGGradients
--------------------------------------------
<html>
<head>
<style>
#svgelem{
position:relative;
left:50%;
-webkit-transform:translateX(-40%);
-ms-transform:translateX(-40%);
transform:translateX(-40%);
}
</style>
<title>SVG</title>
<metacharset = "utf-8" />
</head>
<body>
<h2 align= "center">HTML5 SVG GradientEllipse</h2>
<svg id= "svgelem"height="200" xmlns= "http://www.w3.org/2000/svg">
<defs>
<radialGradientid="gradient"cx ="50%" cy = "50%" r = "50%" fx = "50%"
fy= "50%">
<stopoffset= "0%" style = "stop-color:rgb(200,200,200); stop-opacity:0"/>
<stopoffset= "100%" style = "stop-color:rgb(0,0,255);stop-opacity:1"/>
</radialGradient>
</defs>
<ellipse cx ="100" cy = "50" rx = "100" ry = "50"
style = "fill:url(#gradient)"/>
</svg>
</body>
</html>
HTML5 - SVGStar
-------------------------------------------
<html>
<head>
<style>
#svgelem{
position:relative;
left:50%;
-webkit-transform:translateX(-40%);
-ms-transform:translateX(-40%);
transform:translateX(-40%);
}
</style>
<title>SVG</title>
<metacharset = "utf-8" />
</head>
<body>
<h2 align= "center">HTML5 SVG Star</h2>
<svg id= "svgelem"height="200" xmlns= "http://www.w3.org/2000/svg">
<polygonpoints="100,10 40,180 190,60 10,60 160,180" fill = "red"/>
</svg>
</body>
</html>
DifferencesBetweenSVGandCanvas
--------------------------------------------------------------------------------------------------------------------------------------
----
SVG isa language fordescribing2D graphicsinXML.
Canvasdraws 2D graphics,on the fly(witha JavaScript).
SVG isXML based,whichmeansthateveryelementisavailablewithinthe SVGDOM.
You can attach JavaScripteventhandlersforanelement.
In SVG,each drawnshape isrememberedasanobject.If attributesof anSVG objectare changed,
the browsercan automaticallyre-renderthe shape.
Canvasis renderedpixel bypixel.Incanvas,once the graphicis drawn,itis forgottenbythe browser.
If its positionshouldbe changed,the entire sceneneedstobe redrawn,includinganyobjectsthat
mighthave beencoveredbythe graphic.
SVG Circle
-----------------------------------
<!DOCTYPE html>
<html>
<body>
<svg width="100" height="100">
<circle cx="50" cy="50" r="40" stroke="green"stroke-width="4"fill="yellow"/>
</svg>
</body>
</html>
SVG Rectangle
-----------------------------------
<svg width="400" height="100">
<rect width="400" height="100"style="fill:rgb(0,0,255);stroke-width:10;stroke:rgb(0,0,0)"/>
</svg>
SVG RoundedRectangle
----------------------------------------
<svg width="400" height="180">
<rect x="50" y="20" rx="20" ry="20" width="150" height="150"
style="fill:red;stroke:black;stroke-width:5;opacity:0.5"/>
</svg>
SVG Star
-------------------------------------------
<svg width="300" height="200">
<polygonpoints="100,10 40,198 190,78 10,78 160,198"
style="fill:lime;stroke:purple;stroke-width:5;fill-rule:evenodd;"/>
</svg>
SVG Logo
-----------------
<svg height="130" width="500">
<defs>
<linearGradientid="grad1"x1="0%"y1="0%" x2="100%" y2="0%">
<stop offset="0%"style="stop-color:rgb(255,255,0);stop-opacity:1"/>
<stop offset="100%"style="stop-color:rgb(255,0,0);stop-opacity:1"/>
</linearGradient>
</defs>
<ellipsecx="100" cy="70" rx="85" ry="55" fill="url(#grad1)"/>
<textfill="#ffffff"font-size="45"font-family="Verdana"x="50"y="86">SVG</text>
Sorry,yourbrowserdoesnot supportinline SVG.
</svg>

More Related Content

What's hot

Web Design Course: CSS lecture 1
Web Design Course: CSS lecture 1Web Design Course: CSS lecture 1
Web Design Course: CSS lecture 1Gheyath M. Othman
 
Web Engineering - Basic CSS Properties
Web Engineering - Basic CSS PropertiesWeb Engineering - Basic CSS Properties
Web Engineering - Basic CSS PropertiesNosheen Qamar
 
Web Design Course: CSS lecture 5
Web Design Course: CSS  lecture 5Web Design Course: CSS  lecture 5
Web Design Course: CSS lecture 5Gheyath M. Othman
 
Div Tag Tutorial
Div Tag TutorialDiv Tag Tutorial
Div Tag Tutorialbav123
 
HTML, CSS And JAVASCRIPT!
HTML, CSS And JAVASCRIPT!HTML, CSS And JAVASCRIPT!
HTML, CSS And JAVASCRIPT!Syahmi RH
 
How Cascading Style Sheets (CSS) Works
How Cascading Style Sheets (CSS) WorksHow Cascading Style Sheets (CSS) Works
How Cascading Style Sheets (CSS) WorksAmit Tyagi
 
Introduction to CSS3
Introduction to CSS3Introduction to CSS3
Introduction to CSS3Doris Chen
 
SVG - Scalable Vector Graphic
SVG - Scalable Vector GraphicSVG - Scalable Vector Graphic
SVG - Scalable Vector GraphicAkila Iroshan
 
Html marquee tag
Html marquee tagHtml marquee tag
Html marquee tagYousuf Ali
 
HTML5 and SVG
HTML5 and SVGHTML5 and SVG
HTML5 and SVGyarcub
 
Css types internal, external and inline (1)
Css types internal, external and inline (1)Css types internal, external and inline (1)
Css types internal, external and inline (1)Webtech Learning
 
Quality Development with CSS3
Quality Development with CSS3Quality Development with CSS3
Quality Development with CSS3Shay Howe
 

What's hot (19)

Web Design Course: CSS lecture 1
Web Design Course: CSS lecture 1Web Design Course: CSS lecture 1
Web Design Course: CSS lecture 1
 
Css
CssCss
Css
 
Css
CssCss
Css
 
Web Engineering - Basic CSS Properties
Web Engineering - Basic CSS PropertiesWeb Engineering - Basic CSS Properties
Web Engineering - Basic CSS Properties
 
Web Design Course: CSS lecture 5
Web Design Course: CSS  lecture 5Web Design Course: CSS  lecture 5
Web Design Course: CSS lecture 5
 
Div Tag Tutorial
Div Tag TutorialDiv Tag Tutorial
Div Tag Tutorial
 
HTML, CSS And JAVASCRIPT!
HTML, CSS And JAVASCRIPT!HTML, CSS And JAVASCRIPT!
HTML, CSS And JAVASCRIPT!
 
How Cascading Style Sheets (CSS) Works
How Cascading Style Sheets (CSS) WorksHow Cascading Style Sheets (CSS) Works
How Cascading Style Sheets (CSS) Works
 
Introduction to CSS3
Introduction to CSS3Introduction to CSS3
Introduction to CSS3
 
SVG - Scalable Vector Graphic
SVG - Scalable Vector GraphicSVG - Scalable Vector Graphic
SVG - Scalable Vector Graphic
 
Style and Selector Part2
Style and Selector Part2Style and Selector Part2
Style and Selector Part2
 
Java script
Java scriptJava script
Java script
 
David Weliver
David WeliverDavid Weliver
David Weliver
 
Html marquee tag
Html marquee tagHtml marquee tag
Html marquee tag
 
HTML5 and SVG
HTML5 and SVGHTML5 and SVG
HTML5 and SVG
 
HTML CSS & Javascript
HTML CSS & JavascriptHTML CSS & Javascript
HTML CSS & Javascript
 
css-tutorial
css-tutorialcss-tutorial
css-tutorial
 
Css types internal, external and inline (1)
Css types internal, external and inline (1)Css types internal, external and inline (1)
Css types internal, external and inline (1)
 
Quality Development with CSS3
Quality Development with CSS3Quality Development with CSS3
Quality Development with CSS3
 

Similar to SVG introduction

Sara Soueidan: Styling and Animating Scalable Vector Graphics with CSS [CSSCo...
Sara Soueidan: Styling and Animating Scalable Vector Graphics with CSS [CSSCo...Sara Soueidan: Styling and Animating Scalable Vector Graphics with CSS [CSSCo...
Sara Soueidan: Styling and Animating Scalable Vector Graphics with CSS [CSSCo...Guillaume Kossi
 
Html5 Canvas Detail
Html5 Canvas DetailHtml5 Canvas Detail
Html5 Canvas DetailNisa Soomro
 
JavaONE 2012 Using Java with HTML5 and CSS3
JavaONE 2012 Using Java with HTML5 and CSS3JavaONE 2012 Using Java with HTML5 and CSS3
JavaONE 2012 Using Java with HTML5 and CSS3Helder da Rocha
 
I Can't Believe It's Not Flash
I Can't Believe It's Not FlashI Can't Believe It's Not Flash
I Can't Believe It's Not FlashThomas Fuchs
 
Svg, canvas e animations in angular (3 maggio 2019)
Svg, canvas e animations in angular (3 maggio 2019)Svg, canvas e animations in angular (3 maggio 2019)
Svg, canvas e animations in angular (3 maggio 2019)Leonardo Buscemi
 
SVG, CSS3, and D3 for Beginners
SVG, CSS3, and D3 for BeginnersSVG, CSS3, and D3 for Beginners
SVG, CSS3, and D3 for BeginnersOswald Campesato
 
UI5con 2019 - Integrating D3.js Visualizations via Custom Controls - Live
UI5con 2019 - Integrating D3.js Visualizations via Custom Controls - LiveUI5con 2019 - Integrating D3.js Visualizations via Custom Controls - Live
UI5con 2019 - Integrating D3.js Visualizations via Custom Controls - LiveMaximilian Lenkeit
 
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4Erin M. Kidwell
 
SVG For Web Designers (and Developers)
SVG For Web Designers (and Developers) SVG For Web Designers (and Developers)
SVG For Web Designers (and Developers) Sara Soueidan
 
Svg Overview And Js Libraries
Svg Overview And Js LibrariesSvg Overview And Js Libraries
Svg Overview And Js Librariesseamusjr
 
Thats Not Flash?
Thats Not Flash?Thats Not Flash?
Thats Not Flash?Mike Wilcox
 
The Image that called me - Active Content Injection with SVG Files
The Image that called me - Active Content Injection with SVG FilesThe Image that called me - Active Content Injection with SVG Files
The Image that called me - Active Content Injection with SVG FilesMario Heiderich
 

Similar to SVG introduction (20)

Html 5 svg
Html 5 svgHtml 5 svg
Html 5 svg
 
SVG and the web
SVG and the webSVG and the web
SVG and the web
 
Web Vector Graphics
Web Vector GraphicsWeb Vector Graphics
Web Vector Graphics
 
Sara Soueidan: Styling and Animating Scalable Vector Graphics with CSS [CSSCo...
Sara Soueidan: Styling and Animating Scalable Vector Graphics with CSS [CSSCo...Sara Soueidan: Styling and Animating Scalable Vector Graphics with CSS [CSSCo...
Sara Soueidan: Styling and Animating Scalable Vector Graphics with CSS [CSSCo...
 
Html5 Canvas Detail
Html5 Canvas DetailHtml5 Canvas Detail
Html5 Canvas Detail
 
JavaONE 2012 Using Java with HTML5 and CSS3
JavaONE 2012 Using Java with HTML5 and CSS3JavaONE 2012 Using Java with HTML5 and CSS3
JavaONE 2012 Using Java with HTML5 and CSS3
 
I Can't Believe It's Not Flash
I Can't Believe It's Not FlashI Can't Believe It's Not Flash
I Can't Believe It's Not Flash
 
Svg, canvas e animations in angular (3 maggio 2019)
Svg, canvas e animations in angular (3 maggio 2019)Svg, canvas e animations in angular (3 maggio 2019)
Svg, canvas e animations in angular (3 maggio 2019)
 
HTML5 - A Whirlwind tour
HTML5 - A Whirlwind tourHTML5 - A Whirlwind tour
HTML5 - A Whirlwind tour
 
Html5
Html5Html5
Html5
 
SVG, CSS3, and D3 for Beginners
SVG, CSS3, and D3 for BeginnersSVG, CSS3, and D3 for Beginners
SVG, CSS3, and D3 for Beginners
 
Next generation Graphics: SVG
Next generation Graphics: SVGNext generation Graphics: SVG
Next generation Graphics: SVG
 
Html5 CSS3 jQuery Basic
Html5 CSS3 jQuery BasicHtml5 CSS3 jQuery Basic
Html5 CSS3 jQuery Basic
 
Css animation
Css animationCss animation
Css animation
 
UI5con 2019 - Integrating D3.js Visualizations via Custom Controls - Live
UI5con 2019 - Integrating D3.js Visualizations via Custom Controls - LiveUI5con 2019 - Integrating D3.js Visualizations via Custom Controls - Live
UI5con 2019 - Integrating D3.js Visualizations via Custom Controls - Live
 
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
 
SVG For Web Designers (and Developers)
SVG For Web Designers (and Developers) SVG For Web Designers (and Developers)
SVG For Web Designers (and Developers)
 
Svg Overview And Js Libraries
Svg Overview And Js LibrariesSvg Overview And Js Libraries
Svg Overview And Js Libraries
 
Thats Not Flash?
Thats Not Flash?Thats Not Flash?
Thats Not Flash?
 
The Image that called me - Active Content Injection with SVG Files
The Image that called me - Active Content Injection with SVG FilesThe Image that called me - Active Content Injection with SVG Files
The Image that called me - Active Content Injection with SVG Files
 

Recently uploaded

Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 

Recently uploaded (20)

Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 

SVG introduction

  • 1. SVG standsforScalable VectorGraphicsand itis a language fordescribing2D-graphicsandgraphical applicationsinXMLand the XML isthenrenderedbyan SVGviewer. SVG ismostlyuseful forvectortype diagramslike Piecharts,Two-dimensional graphsinanX,Y coordinate systemetc. SVG became a W3C Recommendation14.January2003 ViewingSVGFiles Most of the webbrowserscandisplaySVGjustlike theycandisplayPNG,GIF,and JPG. InternetExplorerusersmayhave toinstall the Adobe SVG Viewertobe able toview SVGinthe browser. EmbeddingSVGinHTML5 HTML5 allowsembeddingSVGdirectlyusing<svg>...</svg>tagwhichhas followingsimple syntax <svg xmlns= "http://www.w3.org/2000/svg"> ... </svg> HTML5 - SVGCircle Followingisthe HTML5 versionof an SVGexample whichwoulddraw acircle using<circle>tag <!DOCTYPE html> <html> <head>
  • 3. <svg id= "svgelem"height="200" xmlns= "http://www.w3.org/2000/svg"> <circle id= "redcircle"cx = "50" cy = "50" r = "50" fill ="red"/> </svg> </body> </html> HTML5 - SVGRectangle ----------------------------------------------------- <!DOCTYPE html> <html> <head> <style> #svgelem{ position:relative; left:50%;
  • 4. -webkit-transform:translateX(-50%); -ms-transform:translateX(-50%); transform:translateX(-50%); } </style> <title>SVG</title> <meta charset= "utf-8"/> </head> <body> <h2 align= "center">HTML5 SVGRectangle</h2> <svg id = "svgelem"height="200" xmlns="http://www.w3.org/2000/svg"> <rect id = "redrect"width= "300" height= "100" fill ="red"/> </svg> </body> </html>
  • 5. HTML5 - SVGLine ------------------------------------ <!DOCTYPE html> <html> <head> <style> #svgelem{ position:relative; left:50%; -webkit-transform:translateX(-50%); -ms-transform:translateX(-50%); transform:translateX(-50%); } </style> <title>SVG</title> <metacharset = "utf-8" /> </head> <body> <h2 align= "center">HTML5 SVG Line</h2> <svg id= "svgelem"height="200" xmlns= "http://www.w3.org/2000/svg"> <line x1= "0" y1 = "0" x2 = "200" y2 = "100"
  • 6. style = "stroke:red;stroke-width:2"/> </svg> </body> </html> HTML5 - SVGEllipse ------------------------------------------ <!DOCTYPE html> <html> <head> <style> #svgelem{ position:relative; left:50%; -webkit-transform:translateX(-40%); -ms-transform:translateX(-40%); transform:translateX(-40%); } </style> <title>SVG</title> <metacharset = "utf-8" /> </head> <body>
  • 7. <h2 align= "center">HTML5 SVG Ellipse</h2> <svg id= "svgelem"height="200" xmlns= "http://www.w3.org/2000/svg"> <ellipse cx ="100" cy = "50" rx = "100" ry = "50" fill ="red"/> </svg> </body> </html> HTML5 - SVGPolygon -------------------------------------------------- <!DOCTYPE html> <html> <head> <style> #svgelem{ position:relative; left:50%; -webkit-transform:translateX(-50%); -ms-transform:translateX(-50%); transform:translateX(-50%); } </style> <title>SVG</title>
  • 8. <metacharset = "utf-8" /> </head> <body> <h2 align= "center">HTML5 SVG Polygon</h2> <svg id= "svgelem"height="200" xmlns= "http://www.w3.org/2000/svg"> <polygon points= "20,10 300,20, 170,50" fill = "red"/> </svg> </body> </html> HTML5 - SVGPolyline ----------------------------------------------------- <!DOCTYPE html> <html> <head> <style> #svgelem{ position:relative; left:50%; -webkit-transform:translateX(-20%); -ms-transform:translateX(-20%); transform:translateX(-20%); }
  • 9. </style> <title>SVG</title> <metacharset = "utf-8" /> </head> <body> <h2 align= "center">HTML5 SVG Polyline</h2> <svg id= "svgelem"height="200" xmlns= "http://www.w3.org/2000/svg"> <polyline points="0,0 0,20 20,20 20,40 40,40 40,60" fill ="red"/> </svg> </body> </html> HTML5 - SVGGradients -------------------------------------------- <html> <head> <style> #svgelem{ position:relative; left:50%; -webkit-transform:translateX(-40%); -ms-transform:translateX(-40%); transform:translateX(-40%); } </style>
  • 10. <title>SVG</title> <metacharset = "utf-8" /> </head> <body> <h2 align= "center">HTML5 SVG GradientEllipse</h2> <svg id= "svgelem"height="200" xmlns= "http://www.w3.org/2000/svg"> <defs> <radialGradientid="gradient"cx ="50%" cy = "50%" r = "50%" fx = "50%" fy= "50%"> <stopoffset= "0%" style = "stop-color:rgb(200,200,200); stop-opacity:0"/> <stopoffset= "100%" style = "stop-color:rgb(0,0,255);stop-opacity:1"/> </radialGradient> </defs> <ellipse cx ="100" cy = "50" rx = "100" ry = "50" style = "fill:url(#gradient)"/> </svg> </body> </html> HTML5 - SVGStar ------------------------------------------- <html> <head>
  • 11. <style> #svgelem{ position:relative; left:50%; -webkit-transform:translateX(-40%); -ms-transform:translateX(-40%); transform:translateX(-40%); } </style> <title>SVG</title> <metacharset = "utf-8" /> </head> <body> <h2 align= "center">HTML5 SVG Star</h2> <svg id= "svgelem"height="200" xmlns= "http://www.w3.org/2000/svg"> <polygonpoints="100,10 40,180 190,60 10,60 160,180" fill = "red"/> </svg> </body> </html> DifferencesBetweenSVGandCanvas -------------------------------------------------------------------------------------------------------------------------------------- ---- SVG isa language fordescribing2D graphicsinXML.
  • 12. Canvasdraws 2D graphics,on the fly(witha JavaScript). SVG isXML based,whichmeansthateveryelementisavailablewithinthe SVGDOM. You can attach JavaScripteventhandlersforanelement. In SVG,each drawnshape isrememberedasanobject.If attributesof anSVG objectare changed, the browsercan automaticallyre-renderthe shape. Canvasis renderedpixel bypixel.Incanvas,once the graphicis drawn,itis forgottenbythe browser. If its positionshouldbe changed,the entire sceneneedstobe redrawn,includinganyobjectsthat mighthave beencoveredbythe graphic. SVG Circle ----------------------------------- <!DOCTYPE html> <html> <body> <svg width="100" height="100"> <circle cx="50" cy="50" r="40" stroke="green"stroke-width="4"fill="yellow"/> </svg> </body> </html>
  • 13. SVG Rectangle ----------------------------------- <svg width="400" height="100"> <rect width="400" height="100"style="fill:rgb(0,0,255);stroke-width:10;stroke:rgb(0,0,0)"/> </svg> SVG RoundedRectangle ---------------------------------------- <svg width="400" height="180"> <rect x="50" y="20" rx="20" ry="20" width="150" height="150" style="fill:red;stroke:black;stroke-width:5;opacity:0.5"/> </svg> SVG Star ------------------------------------------- <svg width="300" height="200"> <polygonpoints="100,10 40,198 190,78 10,78 160,198" style="fill:lime;stroke:purple;stroke-width:5;fill-rule:evenodd;"/> </svg> SVG Logo ----------------- <svg height="130" width="500"> <defs>
  • 14. <linearGradientid="grad1"x1="0%"y1="0%" x2="100%" y2="0%"> <stop offset="0%"style="stop-color:rgb(255,255,0);stop-opacity:1"/> <stop offset="100%"style="stop-color:rgb(255,0,0);stop-opacity:1"/> </linearGradient> </defs> <ellipsecx="100" cy="70" rx="85" ry="55" fill="url(#grad1)"/> <textfill="#ffffff"font-size="45"font-family="Verdana"x="50"y="86">SVG</text> Sorry,yourbrowserdoesnot supportinline SVG. </svg>