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.
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
leina (optional) | mokwalo | File name; defaults to untitled. |
mofuta (optional) | mokwalo | png, jpg or webp; defaults to png. |
Examples
Section titled “Examples”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");
}
}