SVGImageElement

Baseline Widely available *

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

* Some parts of this feature may have varying levels of support.

Giao diện SVGImageElement tương ứng với phần tử <image>.

EventTarget Node Element SVGElement SVGGraphicsElement SVGImageElement

Thuộc tính phiên bản

Giao diện này cũng kế thừa các thuộc tính từ lớp cha, SVGGraphicsElement.

SVGImageElement.crossOrigin

Một chuỗi phản ánh thuộc tính nội dung crossorigin, đại diện cho cài đặt CORS của phần tử <image> đã cho.

SVGImageElement.decoding

Đại diện cho gợi ý được cung cấp cho trình duyệt về cách giải mã hình ảnh.

SVGImageElement.height Read only

Một SVGAnimatedLength tương ứng với thuộc tính height của phần tử <image> đã cho.

SVGImageElement.href Read only

Một SVGAnimatedString tương ứng với thuộc tính href hoặc xlink:href Deprecated của phần tử <image> đã cho.

SVGImageElement.preserveAspectRatio Read only

Một SVGAnimatedPreserveAspectRatio tương ứng với thuộc tính preserveAspectRatio của phần tử <image> đã cho.

SVGImageElement.width Read only

Một SVGAnimatedLength tương ứng với thuộc tính width của phần tử <image> đã cho.

SVGImageElement.x Read only

Một SVGAnimatedLength tương ứng với thuộc tính x của phần tử <image> đã cho.

SVGImageElement.y Read only

Một SVGAnimatedLength tương ứng với thuộc tính y của phần tử <image> đã cho.

Phương thức phiên bản

Giao diện này cũng kế thừa các phương thức từ giao diện cha, SVGGraphicsElement.

SVGImageElement.decode()

Khởi tạo quá trình giải mã hình ảnh bất đồng bộ. Trả về một Promise được giải quyết khi dữ liệu hình ảnh sẵn sàng để sử dụng.

Thông số kỹ thuật

Specification
Scalable Vector Graphics (SVG) 2
# InterfaceSVGImageElement

Tương thích trình duyệt