String toDataUrl([String type = 'image/png', num quality ])

Return a dataUrl for this BitmapData.

Source

String toDataUrl([String type = 'image/png', num quality]) {
  return this.clone().renderTexture.canvas.toDataUrl(type, quality);
}