aboutsummaryrefslogtreecommitdiff
path: root/files/pt-br/web/svg/element/image
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:42:52 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:42:52 -0500
commit074785cea106179cb3305637055ab0a009ca74f2 (patch)
treee6ae371cccd642aa2b67f39752a2cdf1fd4eb040 /files/pt-br/web/svg/element/image
parentda78a9e329e272dedb2400b79a3bdeebff387d47 (diff)
downloadtranslated-content-074785cea106179cb3305637055ab0a009ca74f2.tar.gz
translated-content-074785cea106179cb3305637055ab0a009ca74f2.tar.bz2
translated-content-074785cea106179cb3305637055ab0a009ca74f2.zip
initial commit
Diffstat (limited to 'files/pt-br/web/svg/element/image')
-rw-r--r--files/pt-br/web/svg/element/image/index.html102
1 files changed, 102 insertions, 0 deletions
diff --git a/files/pt-br/web/svg/element/image/index.html b/files/pt-br/web/svg/element/image/index.html
new file mode 100644
index 0000000000..b14010b60c
--- /dev/null
+++ b/files/pt-br/web/svg/element/image/index.html
@@ -0,0 +1,102 @@
+---
+title: image
+slug: Web/SVG/Element/image
+tags:
+ - Elemento
+ - Gráficos SVG
+ - Referencia
+ - SVG
+translation_of: Web/SVG/Element/image
+---
+<div>{{SVGRef}}</div>
+
+<p>O elemento SVG <code><strong>&lt;image&gt;</strong></code> carrega imagens dentro de documentos SVG. Ele pode exibir arquivos {{glossary("raster image")}} ou outros arquivos SVG.</p>
+
+<p>The only image formats SVG software must support are <a href="/en-US/docs/Glossary/jpeg">JPEG</a>, <a href="/en-US/docs/Glossary/PNG">PNG</a>, and other SVG files. Animated <a href="/en-US/docs/Glossary/gif">GIF</a> behavior is undefined.</p>
+
+<p>SVG files displayed with <code>&lt;image&gt;</code> are <a href="/en-US/docs/Web/SVG/SVG_as_an_Image">treated as an image</a>: external resources aren't loaded, <a href="/en-US/docs/Web/CSS/:visited">:visited</a> styles <a href="/en-US/docs/Web/CSS/Privacy_and_the_:visited_selector">aren't applied</a>, and they cannot be interactive. To include dynamic SVG elements, try <a href="/en-US/docs/Web/SVG/Element/use">&lt;use&gt;</a> with an external URL. To include SVG files and run scripts inside them, try <a href="/en-US/docs/Web/HTML/Element/object">&lt;object&gt;</a> inside of <a href="/en-US/docs/Web/SVG/Element/foreignObject">&lt;foreignObject&gt;</a>.</p>
+
+<div class="note">
+<p><strong>Note:</strong> The HTML spec defines <code>&lt;image&gt;</code> as a synonym for <a href="/en-US/docs/Web/HTML/Element/img">&lt;img&gt;</a> while parsing HTML. This specific element and its behavior only apply inside SVG documents or <a href="/en-US/docs/SVG_In_HTML_Introduction">inline SVG</a>.</p>
+</div>
+
+<h2 id="Usage_context">Usage context</h2>
+
+<p>{{svginfo}}</p>
+
+<h2 id="Attributes">Attributes</h2>
+
+<h3 id="Global_attributes">Global attributes</h3>
+
+<ul>
+ <li><a href="/en-US/docs/Web/SVG/Attribute#Conditional_processing_attributes">Conditional processing attributes</a></li>
+ <li><a href="/en-US/docs/Web/SVG/Attribute#Core_attributes">Core attributes</a></li>
+ <li><a href="/en-US/docs/Web/SVG/Attribute#Graphical_event_attributes">Graphical event attributes</a></li>
+ <li><a href="/en-US/docs/Web/SVG/Attribute#Presentation_attributes">Presentation attributes</a></li>
+ <li><a href="/en-US/docs/Web/SVG/Attribute#Xlink_attributes">Xlink attributes</a></li>
+ <li>{{SVGAttr("class")}}</li>
+ <li>{{SVGAttr("style")}}</li>
+ <li>{{SVGAttr("externalResourcesRequired")}}</li>
+ <li>{{SVGAttr("transform")}}</li>
+</ul>
+
+<h3 id="Specific_attributes">Specific attributes</h3>
+
+<ul>
+ <li>{{SVGAttr("x")}}: Positions the image horizontally from the origin.</li>
+ <li>{{SVGAttr("y")}}: Positions the image vertically from the origin.</li>
+ <li>{{SVGAttr("width")}}: The width the image renders at. Unlike HTML's <code>&lt;img&gt;</code>, this attribute is required.</li>
+ <li>{{SVGAttr("height")}}: The height the image renders at. Unlike HTML's <code>&lt;img&gt;</code>, this attribute is required.</li>
+ <li>{{SVGAttr("href")}} and {{SVGAttr("xlink:href")}}: Points at a URL for the image file.</li>
+ <li>{{SVGAttr("preserveAspectRatio")}}: Controls how the image is scaled.</li>
+</ul>
+
+<h2 id="DOM_Interface">DOM Interface</h2>
+
+<p><code>&lt;image&gt;</code> implements the {{domxref("SVGImageElement")}} interface.</p>
+
+<h2 id="Example">Example</h2>
+
+<p>Basic rendering of a PNG image in SVG:</p>
+
+<h3 id="SVG">SVG</h3>
+
+<pre class="brush: html">&lt;svg width="200" height="200"
+ xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"&gt;
+ &lt;image href="https://mdn.mozillademos.org/files/6457/mdn_logo_only_color.png" height="200" width="200"/&gt;
+&lt;/svg&gt;
+</pre>
+
+<h3 id="Result">Result</h3>
+
+<p>{{EmbedLiveSample("Example", 250, 260)}}</p>
+
+<h2 id="Specifications">Specifications</h2>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{SpecName('SVG2', 'embedded.html#ImageElement', '&lt;image&gt;')}}</td>
+ <td>{{Spec2('SVG2')}}</td>
+ <td>Allows omitting <code>height</code> and <code>width</code></td>
+ </tr>
+ <tr>
+ <td>{{SpecName('SVG1.1', 'struct.html#ImageElement', '&lt;image&gt;')}}</td>
+ <td>{{Spec2('SVG1.1')}}</td>
+ <td>Initial definition</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Browser_compatibility">Browser compatibility</h2>
+
+
+
+<p>{{Compat("svg.elements.image")}}</p>