English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Referenzhandbuch

Vollständiges Verzeichnis der HTML-Tags

HTML canvas lineJoin Eigenschaft

lineJoin ist eine Eigenschaft von Canvas 2D API wird verwendet, um zu setzen2Eine Eigenschaft, die angibt, wie zwei Teile eines nicht Null-Längen (Linienabschnitte, Kurven, Bögen) miteinander verbunden werden (Teile mit einer Länge von 0, deren Endpunkte und Steuerepunkte an derselben Position sind, werden ignoriert).

HTML canvas Reference Manual

Online-Beispiel

Erstellt eine Kante mit abgerundeten Ecken, wenn zwei Linien sich schneiden:

Ihr Browser unterstützt keine HTML5 canvas-Tag.
<!DOCTYPE html>
<html>
<head>
<title>Verwendung der lineJoin-Eigenschaft von HTML canvas (Grundtutorials.net oldtoolbag.com)</<title>
</<head>
<body>
<canvas id="myCanvas" width="300" height="150" style="border:1px solide #d3d3d3>
Ihr Browser unterstützt keine HTML5 canvas 标签。</canvas>
<script>
var c=document.getElementById("myCanvas");
var ctx=c.getContext("2d");
ctx.beginPath();
ctx.lineWidth=10;
ctx.lineJoin="round";
ctx.moveTo(20,20);
ctx.lineTo(100,50);
ctx.lineTo(20,100);
ctx.stroke();
</script>
</body>
</html>
Test and see ‹/›

Browser Compatibility

IEFirefoxOperaChromeSafari

Internet Explorer 9, Firefox, Opera, Chrome and Safari support the lineJoin attribute.

Note:Internet Explorer 8 and earlier versions do not support the <canvas> element.

Definition and Usage

When two lines meet, the lineJoin attribute sets or returns the type of angle created.

Note:The "miter" value is affected bymiterLimit Attribute Effects.

Default Value:miter
JavaScript Syntax:context.lineJoin="bevel|round|miter";

Attribute Value

 
ValueDescription
bevelCreate a slanted angle.
roundCreate a rounded corner.
miterDefault. Create a sharp angle.
HTML canvas Reference Manual