Helion Bestsellery

Czysty kod. Podręcznik dobrego programisty
  • Autor: Robert C. Martin
  • Zniżka: 35%
  • Cena: 79.00 51.35 zł
  • Marka: Helion
  • Status: Dostępna
  • Typ: Książka
  • EAN: 9788383223445
  • ISBN: 978-83-8322-344-5
Dodaj Czysty kod. Podręcznik dobrego programisty do koszyka

Helion Książka Dnia

Algorytmy w Pythonie. Techniki programowania dla praktyków
  • Autor: Piotr Wróblewski
  • Zniżka: 50%
  • Cena: 119.00 59.50 zł
  • Marka: Helion
  • Status: Dostępna
  • Typ: Książka
  • EAN: 9788328393684
  • ISBN: 978-83-283-9368-4
Dodaj Algorytmy w Pythonie. Techniki programowania dla praktyków do koszyka

save()

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

CanvasRenderingContext2D.save()

[_] [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]

save()

 

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 = "blue";
ctx.fillRect(50, 50, 150, 150);

ctx.save();

ctx.fillStyle = "yellow";
ctx.fillRect(300, 50, 150, 150);
ctx.fillRect(50, 300, 150, 150);

ctx.restore();

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

return;

};

</script>

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

 

  

Opis:
Metoda CanvasRenderingContext2D.save() zapisuje cały stan canvas poprzez wypychanie bieżącego stan na stos. Stan rysunku zapisywany na stosie składa się z: bieżąca macierz transformacji, bieżący region przycinania, aktualna lista myślników, bieżące wartości następujących atrybutów: strokeStyle, fillStyle, globalAlpha, lineWidth, lineCap, lineJoin, miterLimit, lineDashOffset, shadowOffsetX, shadowOffsetY, shadowBlur, shadowColor, globalCompositeOperation, font, textAlign, textBaseline, direction, imageSmoothingEnabled.

Zobacz też:
strokeStyle -
fillStyle -
globalAlpha -
lineWidth, lineCap -
lineJoin -
miterLimit -
lineDashOffset -
shadowOffsetX -
shadowOffsetY -
shadowBlur -
shadowColor -
globalCompositeOperation -
font -
textAlign -
textBaseline -
direction -
imageSmoothingEnabled -

 

 

 

 

 

Please publish modules in offcanvas position.