|
You last visited: Today at 12:46
Advertisement
Canvas Kreis zeichnen?!
Discussion on Canvas Kreis zeichnen?! within the General Coding forum part of the Coders Den category.
07/11/2017, 08:57
|
#1
|
elite*gold: 25
Join Date: Apr 2009
Posts: 470
Received Thanks: 160
|
Canvas Kreis zeichnen?!
Hey Leute ,
Ich wollte mal fragen ob mir jemand behilflich sein könnte, und zwar müsste ich mithilfe von canvas einen Kreis der durch eine Eingabe von einem Radius erstellt wird , programmieren.
Das alles in Lazarus bzw. Delphi
|
|
|
07/11/2017, 09:05
|
#2
|
elite*gold: 100
Join Date: Apr 2008
Posts: 860
Received Thanks: 1,487
|
Ein Thread reicht doch, oder?
|
|
|
07/11/2017, 09:12
|
#3
|
elite*gold: 25
Join Date: Apr 2009
Posts: 470
Received Thanks: 160
|
Quote:
Originally Posted by florian0
Ein Thread reicht doch, oder?

|
War mir nicht sicher in welcher sub section das rein muss
|
|
|
07/13/2017, 14:06
|
#4
|
elite*gold: 150
Join Date: Sep 2010
Posts: 2,070
Received Thanks: 821
|
Siehe 
Etwas googlen schadet nie.
|
|
|
07/20/2017, 15:39
|
#5
|
elite*gold: 0
Join Date: Jul 2008
Posts: 1,826
Received Thanks: 226
|
PHP Code:
<!DOCTYPE html> <html> <body>
<canvas id="myCanvas" width="300" height="150" style="border:1px solid #d3d3d3;"> Your browser does not support the HTML5 canvas tag.</canvas>
<input type="Number" id="radius" value="2" onChange="drawCircle()" />
<script>
function drawCircle(){ var c = document.getElementById("myCanvas"); var ctx = c.getContext("2d"); var radius = document.getElementById("radius").value; ctx.clearRect(0, 0, 300, 150); //clear the canvas before redrawing the circle ctx.beginPath(); //begin drawing ctx.arc(100, 75, 50, radius, 2 * Math.PI); //make a curve ctx.stroke(); //stop drawing };
drawCircle();
</script>
</body> </html>
War ne Arbeit von 5 Minuten, hätte man auch mit Googlen wahrscheinlich noch schneller schaffen können...
_
mhaendler
//EDIT Sorry mein Fehler, hab das mit der Sprache überlesen...
|
|
|
07/20/2017, 19:37
|
#6
|
elite*gold: 0
Join Date: Feb 2009
Posts: 1,137
Received Thanks: 573
|
Quote:
Originally Posted by mhaendler
PHP Code:
<!DOCTYPE html>
<html>
<body>
<canvas id="myCanvas" width="300" height="150" style="border:1px solid #d3d3d3;">
Your browser does not support the HTML5 canvas tag.</canvas>
<input type="Number" id="radius" value="2" onChange="drawCircle()" />
<script>
function drawCircle(){
var c = document.getElementById("myCanvas");
var ctx = c.getContext("2d");
var radius = document.getElementById("radius").value;
ctx.clearRect(0, 0, 300, 150); //clear the canvas before redrawing the circle
ctx.beginPath(); //begin drawing
ctx.arc(100, 75, 50, radius, 2 * Math.PI); //make a curve
ctx.stroke(); //stop drawing
};
drawCircle();
</script>
</body>
</html>
War ne Arbeit von 5 Minuten, hätte man auch mit Googlen wahrscheinlich noch schneller schaffen können...
_
mhaendler
|
Nur leider ist das kein Pascal Code sondern Javascript
|
|
|
07/20/2017, 19:41
|
#7
|
elite*gold: 100
Join Date: Sep 2010
Posts: 2,440
Received Thanks: 661
|
|
|
|
 |
Similar Threads
|
Kreis mithilfe von Vertices zeichnen
11/01/2013 - C/C++ - 8 Replies
Ich würde gerne mithilfe von DirectX und Vertices einen Kreis zeichnen. Nach etwas Recherche hatte ich dann meine benötigte Formel und machte mich gleich mal ran, Ergebnis ist folgendes:
http://i.epvpimg.com/k8L5g.png
Allerdings gibt es da ein Problem mit dem letzten Dreieck, es wird einfach nicht gezeichnet. Hatte heute morgen ungefähr 2 Stunden mit Debugging verbracht und ich finde den Fehler einfach nicht, die Werte sind korrekt und es werden wirklich alle Vertices richtig gesetzt.
...
|
[HTML5] Canvas Rotiert nicht um den Mittelpunkt
09/13/2013 - Web Development - 1 Replies
Hallo,
Ich habe heute ein kleines Script erstellt, welches verschiedenfarbige Quadrate erstellt. Nun wollte ich diese noch dazu bringen sich um den Mitelpunkt zu rotieren allerdings schaffe ich das nicht so ganz.
Mein Code:
Animation Test - Pastebin.com
Kann mir einer sagen was mein Fehler ist?
|
[REQUEST] Html5, canvas to png - help needed (For DO-remix)
06/23/2013 - DarkOrbit - 0 Replies
Can anybody help me with this ?
I must convert this canvas in html5 to pngs becouse i need them to DO remix.
Greetings.
Zippyshare.com - Sprite.rar
|
[help] JS/canvas button
01/20/2013 - Web Development - 2 Replies
Hi,
i would like to ask for some help, i am trying to make a Button using canvas and JavaScript, but i cant get rounded corners... i googled but didnt find anything that could help me out... so im turning myself on you guys :)
here's what i got now:
function drawCanvas1() {
var gradientCanvas = document.getElementById('gradientCanvas');
var context = gradientCanvas.getContext('2d');
var myGradient = context.createLinearGradient(0, 60, 0, 0);
|
Halloween Index Design Mystic's Canvas
12/10/2011 - Metin2 PServer Guides & Strategies - 4 Replies
http://mystic.design.tl/indexdesigns/yilbasi/arka. png
http://virustotal.hispasecsistemas.netdna-cdn.com /img/VirusTotal-logo.png
DEMO
Yilbasi Design by Mystic09
DOWNLOAD
|
All times are GMT +1. The time now is 12:47.
|
|