aboutsummaryrefslogtreecommitdiff
path: root/files/es/web/api/htmlimageelement/image/index.html
blob: 7bf5d299b50ce97542ab1d8cd62da661bf803929 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
---
title: Image()
slug: Web/API/HTMLImageElement/Image
translation_of: Web/API/HTMLImageElement/Image
---
<div>{{ APIRef("HTML DOM") }}</div>

<h3 id="Constructor_del_elemento_de_Imagen">Constructor del elemento de Imagen</h3>

<p><span style="line-height: 1.572;">Acepta dos parametros opcionales: </span><span style="font-family: courier new,andale mono,monospace; line-height: normal;">Image([unsigned long <em><strong>width</strong></em>, unsigned long <em><strong>height</strong></em>]</span><span style="font-family: courier new,andale mono,monospace; line-height: normal;">)</span></p>

<p>Devuelve un  <a href="/en-US/docs/Web/API/HTMLImageElement" style="line-height: 1.572;" title="en/DOM/HTMLImageElement">HTMLImageElement</a><span style="line-height: 1.572;"> instanciado  justo como</span><span style="line-height: 1.572;"> </span><code style="font-size: 14px;">document.createElement('img')</code><span style="line-height: 1.572;"> would.</span></p>

<p><span style="line-height: 1.572;">Ejemplo:</span></p>

<pre class="brush: js">var myImage = new Image(100, 200);
myImage.src = 'picture.jpg';
console.log(myImage);</pre>

<div>Resultado:</div>

<pre class="brush: html">&lt;img width="100" height="200" src="picture.jpg"&gt;
</pre>

<div>
<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
  <tr>
   <td><a class="external external-icon" href="http://www.w3.org/TR/html5/embedded-content-0.html#dom-image" hreflang="en" lang="en">HTML5<br>
    <small>La definición del constructor de imagen, en esta especificación.</small></a></td>
   <td><span class="spec-REC">Recommendación</span></td>
   <td>Un constructor (con 2 parametros opcionales) han sido agregados.<br>
    Las siguientes propiedades ahora son obsoletas: <code>name</code>, <code>border</code>, <code>align</code>, <code>hspace</code>, <code>vspace</code>, and <code>longdesc</code>.<br>
    The following properties are now <code>unsigned long</code>, instead of <code>long</code>: <code>height</code>, and <code>width</code>.<br>
    Las siguientes propiedadeas ahora han sido agrgados: <code>crossorigin</code>,</td>
  </tr>
 </tbody>
</table>
</div>

<div> </div>