Skip to content
ExamplesOpen editor ↗

bolokaKanefase

→ saveCanvas()

Downloads the canvas as an image.

bolokaKanefase([leina], [mofuta])

Starts a browser download of the current canvas. PNG is the default format; png, jpg and webp are supported. Call it from a user click or key action. The browser may ask where to save. This downloads an image, not the Bopa source. Custom embeds must allow downloads in every sandboxed ancestor iframe.

NameTypeDescription
leina (optional)mokwaloFile name; defaults to untitled.
mofuta (optional)mokwalopng, jpg or webp; defaults to png.
Downloads the canvas as an image
tiro setaLoeto() {
  thalaKanefase(320, 220);
  bokamorago(235);
  tlatsaMmala(30, 145, 160);
  thalaSediko(160, 90, 85);
  tlatsaMmala(30);
  bogoloJwaMokwalo(17);
  thalaMokwalo("Tobetsa B go boloka PNG", 50, 185);
  emisaPoapoeletso();
}

tiro taetsiETobeditswe() {
  fa (taetsi === "b" || taetsi === "B") {
    bolokaKanefase("thama", "png");
  }
}

thalaKanefase, taetsiETobeditswe