Helion Bestsellery

Architektura oprogramowania. Rusz głową! Przewodnik po myśleniu architektonicznym
  • Autor: Raju Gandhi, Mark Richards, Neal Ford
  • Zniżka: 40%
  • Cena: 129.00 77.40 zł
  • Marka: Helion
  • Status: Dostępna
  • Typ: Książka
  • EAN: 9788328915671
  • ISBN: 978-83-289-1567-1
Dodaj Architektura oprogramowania. Rusz głową! Przewodnik po myśleniu architektonicznym do koszyka

Helion Książka Dnia

Superinteligencja. Scenariusze, strategie, zagrożenia
  • Autor: Nick Bostrom
  • Zniżka: 50%
  • Cena: 69.00 34.50 zł
  • Marka: Helion
  • Status: Dostępna
  • Typ: Książka
  • EAN: 9788328903272
  • ISBN: 978-83-289-0327-2
Dodaj Superinteligencja. Scenariusze, strategie, zagrożenia do koszyka

restore()

[ Leksykon ] [ JavaScript ] [ Metody ] [ Właściwości ] [ canvas ] [ CanvasRenderingContext2D ]

CanvasRenderingContext2D.restore()

[_] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y] [Z]

restore()

 

Przykłady:

<script>

window.onload = () => {

const szer = 600;
const wys = 600;

const canvas = document.getElementById("canvas");
canvas.width = szer;
canvas.height = wys;
const ctx = canvas.getContext("2d");

ctx.fillStyle = "orange";

ctx.save();

ctx.fillStyle = "yellow";
ctx.fillRect(50, 300, 150, 150);
ctx.transform(1, 0, 1.1, 1, 1, 1);
ctx.fillStyle = "green";
ctx.fillRect(100, 100, 100, 100);
ctx.fillRect(0, 50, 50, 50);

ctx.resetTransform();


ctx.restore();

ctx.fillRect(300, 300, 150, 150);

return;

};

</script>

<canvas id="canvas" width="100" height="100"></canvas>

 

  

Opis:
Metoda CanvasRenderingContext2D.restore() przywraca ostatnio zapisany stan obszaru roboczego poprzez wyświetlenie najwyższego wpisu na stosie stanu rysunku. Jeśli nie ma zapisanego stanu, ta metoda nie robi nic.

Zobacz też:
save() - 

 

 

 

 

 

Please publish modules in offcanvas position.