473,796 Members | 2,583 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

curves on canvas

I'm drawing curves on a canvas. And then redrawing, re-redrawing, ...

Are there any tools that could help me draw in something more graphic
than the eight arguments of the Bezier curve?
Aug 20 '08 #1
11 1685
No answers. I'll take that for "no". Guess I'll have to write one.
Aug 21 '08 #2
Ma************@ gmail.com wrote.
No answers.
It is Thursday/Friday. Some people here do have a job IRL.

Please learn to quote, and get a real name.
PointedEars
--
var bugRiddenCrashP ronePieceOfJunk = (
navigator.userA gent.indexOf('M SIE 5') != -1
&& navigator.userA gent.indexOf('M ac') != -1
) // Plone, register_functi on.js:16
Aug 21 '08 #3
MartinRineh...@ gmail.com wrote:
I'm drawing curves on a canvas. And then redrawing, re-redrawing, ...

Are there any tools that could help me draw in something more graphic
than the eight arguments of the Bezier curve?
There was a recent thread in this group which covered various possible
approaches:
http://groups.google.com/group/comp....556e6d8dbd61c/

Hope this helps,

--
Bart
Aug 21 '08 #4
Bart Van der Donck wrote:
MartinRineh...@ gmail.com wrote:
>I'm drawing curves on a canvas. And then redrawing, re-redrawing, ...

Are there any tools that could help me draw in something more graphic
than the eight arguments of the Bezier curve?

There was a recent thread in this group which covered various possible
approaches:
http://groups.google.com/group/comp....556e6d8dbd61c/
>
Hope this helps,
Thanks, it is fun to see
http://www.walterzorn.com/jsgraphics...tm#performance
and his homepage with selfmade carbonfiber bike... a really admirable guy.
Aug 21 '08 #5
Thanks Bart, but not the ticket. I'm using the <canvastag, which
works well per w3c pre-standard in Firefox, Opera, Safari and
Konqueror. Pretty good 2D drawing capability. A <canvaspentag on is a
simple matter of creating a five-point path and then reqesting a fill
operation. You could do a slick one with a separate linear gradient
for each point. 10-15 minutes to do it. Replace the straight lines
with Bezier curves - another 5-10 minutes.The problem: maybe half a
day futzing with JavaScript function coords to get one that really
looked good. <canvas>-specific paint program needed.

I don't really care about MSIE-only people (I'm too old to spend any
more time working around those bugs). There is a Google plug-in that
enables <canvasin MSIE. (Isn't DLing a decent browser easier?)

Zorn's stuff IS VERY cool. If you missed his drag-n-drop, go back and
take a look.

Pointed Ears: Full last name is Rinehart. You could try Google Groups
and click "view profile".
Aug 21 '08 #6
Ma************@ gmail.com wrote:
Zorn's stuff IS VERY cool.
It might look cool in a few browsers, but on a closer look it is among the
worst script code I/we have ever seen here. We have even discussed the
flaws of it shortly (ago).
Pointed Ears:
It is spelled differently, you know.
Full last name is Rinehart. You could try Google Groups
and click "view profile".
Or you could stop acting like a googlodyte, click "Subscribe to this group"
and simply have your From header say so. (I have mentioned that before.)
PointedEars
--
var bugRiddenCrashP ronePieceOfJunk = (
navigator.userA gent.indexOf('M SIE 5') != -1
&& navigator.userA gent.indexOf('M ac') != -1
) // Plone, register_functi on.js:16
Aug 21 '08 #7
Thomas 'PointedEars' Lahn wrote:
Pointed Ears:

It is spelled differently, you know.
Sorry, PointedEars. I've subscribed to other groups and gone back to
Google. If you know of a better, please suggest it.

All: The lawn needs mowing. This is a procrastination . Put it in your
non-MSIE browser.

<! pentagon.html - draw a slicked up pentagon>
<! copyright 2008, Martin Rinehart>

<html>
<head>
<titlePentago n! </title>

<script>

function draw() {

cnvs = document.getEle mentById( 'cnvs' );
var pen = cnvs.getContext ('2d');

var rg = pen.createRadia lGradient(
170, 180, 5, 202, 207, 170 );
rg.addColorStop ( 0, '#ffffff' );
rg.addColorStop ( 1, '#0000ff' );
pen.fillStyle = rg;

pen.beginPath() ;
pen.moveTo( 72, 153 );
pen.lineTo( 202, 41 );
pen.lineTo( 330, 153 );
pen.lineTo( 282, 339 );
pen.lineTo( 120, 339 );

pen.fill();

} // end of draw()

</script>
</head>

<body onload=draw()>
<center>

<hr width=80%>
<h1Pentagon with Off-Center Radial Gradient </h1>
<hr width=80%>

<canvas id=cnvs border=0 height=400 width=400>
Sorry. I'm too old to support MSIE.
</canvas>

</center>
</body>

</html>

<! end of pentagon.html>
Aug 21 '08 #8
SAM
Ma************@ gmail.com a écrit :
Thomas 'PointedEars' Lahn wrote:
>>Pointed Ears:
It is spelled differently, you know.
Oh Yes ! right one is : OreillesPointée s
All: The lawn needs mowing. This is a procrastination . Put it in your
non-MSIE browser.

<! pentagon.html - draw a slicked up pentagon>
<! copyright 2008, Martin Rinehart>
works fine, but ...
that is not a (regular) pentagone.

--
sm
Aug 22 '08 #9

SAM wrote:
works fine, but ...
that is not a (regular) pentagone.
You've sharp eyes. It's a pentagonal approximation.

To skip the math, I found a pentagon in Wikipedia and drew it as an
image in my canvas. Then I wrote lines over it and fiddled them to
cover the Wiki drawing. When they looked fairly pentagonish, I deleted
the image. If you shrink the second circle in the radial gradient, you
can get a good view of the errors.
Aug 23 '08 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2210
by: Mickel Grönroos | last post by:
Hi, I'm trying to put an Tkinter.Entry of fixed size onto a specific location on a canvas using the place manager. The idea is that one can double-click a rectangle object on a canvas to get an entry field of the same size as the rectangle placed exactly over the rectangle thus creating the effect that the rectangle has entered "input mode". When clicking return in the entry field, the value is fed back to a text object within the...
1
3139
by: Mickel Grönroos | last post by:
Hi, I have a Tkinter.Canvas of variable width. Is there a standard way of asking the canvas which parts of it that is visible? I.e. on the horizontal scale, I would like to know at what fraction from the left the left visibility border is and from what fraction to the right the right visibility border is. Consider this ascii picture as an example
9
5181
by: Warren Francis | last post by:
I'm fairly new to Python (2-3 months) and I'm trying to figure out a simple way to implement Bezier curves... So far I've tried the following: http://runten.tripod.com/NURBS/ ....which won't work because the only compiled binaries are for Windows 2000, python 2.1. I'm on Windows XP (for now), using Python 2.4. I downloaded the source distribution, but the header files aren't included, so I'm not sure how to compile it. It appears...
2
18299
TMS
by: TMS | last post by:
Schools over!!! Now its time to play. I would like to learn how to make objects move from one location to the next on a canvas widget. For example: from Tkinter import * class square: def __init__(self, canvas, xy, color, change): self.canvas = canvas self.id = self.canvas.create_rectangle(-10-abs(change),
6
3573
by: Nebulism | last post by:
I have been attempting to utilize a draw command script that loads a canvas, and through certain mouse events, draws rectangles. The original code is from http://www.java2s.com/Code/Python/Event/Usemousetodrawashapeoncanvas.htm . The code itself is: from Tkinter import * trace = 0 class CanvasEventsDemo: def __init__(self, parent=None): canvas = Canvas(width=300, height=300, bg='beige') canvas.pack()
4
5454
by: sagar | last post by:
Hello Friends, I am working on a web application in which I have a map loaded on the page and I am required to dynamically draw points, lines, curves on the map to show a location, road etc. Kindly tell me if these is a javascript/ajax library/tool to perform such actions.
2
5678
by: devnew | last post by:
hi i am new to tkinter and would like some help with canvas i am doing validation of contents of a folder and need to show the ok/error messages on a canvas resultdisplay =Canvas(...) errmessage="error!" okmessage="dir validation ok!"
10
7372
by: blaine | last post by:
Hey everyone! I'm not very good with Tk, and I am using a very simple canvas to draw some pictures (this relates to that nokia screen emulator I had a post about a few days ago). Anyway, all is well, except one thing. When I am not in the program, and the program receives a draw command (from a FIFO pipe), the canvas does not refresh until I click into the program. How do I force it to refresh, or force the window to gain focus? It...
4
10098
by: moondaddy | last post by:
I have a wpf project where I use a canvas to drag shapes around. when I drag a shape beyond the right or bottom side I get scrollbars which is good. I also get scrollbars when I zoom in and a shape goes beyond the right or bottom side. However, I don't get scrollbars when shapes move beyond the left or top side of the canvas. This is bad. I need the behavior similar to Visio where you can drag an object past the left or top and you will...
0
9680
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10455
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10228
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10173
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10006
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5441
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4116
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3731
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2925
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.