Data Uri生成器

Data Uri生成器 · image.dataUri. 生成方法 · 示例

image.dataUri

生成设置

生成后在这里查看结果。

参数 & 示例

Generates a random data uri containing an URL-encoded SVG image or a Base64-encoded SVG image.

image.dataUri(options?: { width?, height?, color?, type? })
options
Options for generating a data uri.
options.width
The width of the image. Defaults to a random integer between 1 and 3999.
options.height
The height of the image. Defaults to a random integer between 1 and 3999.
options.color
The color of the image. Must be a color supported by svg. Defaults to a random color.
options.type
The type of the image. Defaults to a random type.

示例

"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20baseProfile%3D%22full%22%20width%3D%222672%22%20height%3D%22546%22%3E%3Crect%20…

请在测试环境使用合成数据。

相关生成器

探索场景模板