Line Drawing Library
Jul 23, 2005
Is there a small graphics library that I can use? All I need to do is
draw a line of a nominated thickness and colour between two specified
points and to, at some later time, "delete" the line?
I've found a few offerings but either they weren't multi-browser
compatible or they were too big for me to consider (20K instead of 2 or 3K).
View 8 Replies
ADVERTISEMENT
Nov 19, 2011
We currently have a website that uses the .beforeAfter plugin to switch between two images. In addition we would like to add the possibility to draw a line and/or box using a boxer like option. All our attempts have been unsuccessful so far.
Could anyone tell us if and how it is possible to combine the .beforeAfter option with a drawing line/box one?
For curious users, here is the website we are currently working on:
[URL]
View 3 Replies
View Related
Jul 2, 2009
I adapted Bresenham line drawing algorithm to draw a dashed line. I want to count the number of dashes. The dashes extend from one city on a map to another city. I don't want the dashes to obscure the city marker which is a small black dot, so I added some logic to skip dashes at the start of the line and at the end of the line. But this logic is confounding my attempt to count the dashes and I haven't been able to figure out why. The function should return the number of dashes as 'count'.
View 3 Replies
View Related
Apr 8, 2010
I am using GreaseMonkey to load jQuery 1.3.2 (there is a bug with the latest version of jquery and GM) and jQuery UI 1.8.0.I am using jQuery via GM to manipulate the GUI of a content management system. This CMS uses its own JS library to dynamically add stuff to the dom.
Question:How can I target a dom element that was added to the dom via this other JS lib?In other words, the CMS will add a div to the dom, and I am not sure how to tell jquery to wait for these elements to "be there" before applying the jquery goodness. Specifically, I would like to do this:
$(function() {
$('#zen1227').resizable();
});
But "#zen1227" does not "appear" until later via this other JS library.
View 4 Replies
View Related
May 25, 2010
how to read a text file using javascript line by line and separate from special characters in it. for example
Text.txt has
001203=Line one=abc.html
024353=Line two=xyz.html
092434=Line three=hjf.html
i want each column in an array like { 001203,024353,092434 } so total 3 arrays.
View 14 Replies
View Related
Feb 22, 2010
getting first line coordinates of multiple line inline element.
Example HTML
aaa bbb ccc ddd <span id="target">eee fff ggg
hhh iii jjj</span>kkk lll mmm nnn ooo ppp qqq
$(document).ready(function() {
[Code]....
Assume that span#target has a line break, when I see a browser. Then I click span#target, above function returns the head of coordinates which second line ("hhh") has. I want to have the coordinates which first line ("eee") has. How can I get that?
View 1 Replies
View Related
Aug 9, 2006
I heard or read that the next version of HTML will provide long-overdue drawing commands.
Which version of Firefox, Opera or IE supports such new fancy stuff?
View 7 Replies
View Related
Jan 11, 2012
reading file in jQuery. Please if anyone knows how to write tome or to the website.
$.get("data/zelis.si.txt",function(data){
$.each(lines, function(n,line){
$.ajax({
[code]....
View 7 Replies
View Related
Jul 23, 2005
I need to use javascript's graphics API to draw the letters of
the alphabet. If necessary, I can map out all 26 letters myself
and use drawline() to draw them, but I am hoping someone out
there might have a better suggestion. The user will click a spot
on the canvas, and the script will draw one of the letters at
that spot.
View 2 Replies
View Related
Jul 31, 2002
An interesting way of drawing a line interactively without the need for any plug-ins....
View 6 Replies
View Related
Oct 6, 2009
i want to let the user draw image or drawings on web page using html canvas element like stuff and then provide them to save that image or drawing on server so that next time they can get it as it was before to edit further.
View 1 Replies
View Related
Oct 21, 2009
I'm having a problem with the <CANVAS> element in JavaScript. here's what i'm trying to do: I need 3 different canvas elements for writing a signature to. they must all 3 be visible at the same time
My problem that i'm having is that i can't seem to get the code to work which will write to more than one canvas.
[Code]...
View 2 Replies
View Related
Mar 21, 2010
I am trying to create an Asteroids type game using JavaScript along with html5's canvas element for drawing. I have searched around and have looked at examples but I can't figure out what is wrong with my rendering that I do in the game loop that is run every frame. The problem appears to be only that the canvas is not cleared at the beginning of each frame but I feel there might be something wrong also. The code used and shown below only works in Firefox but not Google Chrome or Safari.
[Code]...
View 2 Replies
View Related
Dec 8, 2010
I want to create a drawing board in an html page were i can draw anything by dragging the mouse. and when i have done the drawing, i want to create an image of that drawing,
i found some examples doing this but so far all were using html 5, my requirement is to support most of the available browsers.
does anyone knows how i can do it.
i found one link which had what i required, [code]...
but in this the only problem is that if i drag my mouse faster, the draw line is discontinuous. i want it to be continuous free flowing colored pixels.
View 1 Replies
View Related
Dec 27, 2010
This is a question concerning the SVG plug in,Here is the code
<html>
<head>
<script language="javascript" type="text/javascript" src="jquery.js"></script>[code].....
1.SVG isn't drawing the circle
2. var svg is undefined keeps popping up.
View 2 Replies
View Related
Oct 27, 2009
I'm trying to complete an application drawing of graphs or bar charts
I'm attempting to write a script that reads five numbers between 1 and 30.
For each number read, output XHTML text that displays a line containing that number of adjacent asterisks.
This is code I've come up with so far.
<?xml version = "1.0"encoding = "utf-8"?>
<!DOCTYPE html PUBLIC "-w3cDTD XHTML 1.0 StrictEN"
"http:www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns = "http:www.w3.org/1999/xhtml">
[Code].....
View 1 Replies
View Related
Sep 30, 2009
I am working on an application where the user is able to draw using square images placed using absolute positions. The user can draw any shape but it must always be connected. I now need to work out the outline of the shape they created. The only information I have is the x y of the pictures that were placed. Its driving me crazy... I tried to work out a system of looping through all the pictures and seeing if there were any images touching.
My most recent idea was to make the javascript select the images and see if I could get the coordinates of the shape from there... In simple I need a way of merging the images into a shape rather than separate entities.
View 2 Replies
View Related
Jun 15, 2011
I want to draw growing circles like a darts board and like attached picture using jQuery (I prefer) or another javascript library.
View 7 Replies
View Related
Oct 21, 2011
I've coded in Java before but I'm still having some trouble. I am trying to draw a ribbon type shape on an <canvas> element and for some reason, when I turned it into a function, it seemed not to work. Here is what I have for drawing the ribbon with a function:
function drawRibbon(height,width,Canvas){
var c=document.getElementById(Canvas);
var cxt=c.getContext("2d");
cxt.fillStyle="#bb0044";
cxt.beginPath();
cxt.moveTo(0,0);
cxt.lineTo(0,height-50);
cxt.lineTo((width-20)/2,height-100);
cxt.lineTo((width-20),height-50);
cxt.lineTo(width-20,0);
cxt.shadowOffsetX = 5;
cxt.shadowOffsetY = 10;
cxt.shadowBlur=10;
cxt.shadowColor = "black";
cxt.fill();
cxt.shadowOffsetX = 0;
cxt.shadowOffsetY = 0;
cxt.shadowBlur=0;
cxt.closePath();
cxt.beginPath();
cxt.strokeStyle = "#ffcc22";
for (i=5;i <= 135; i=i+15){
cxt.moveTo(5,i);
cxt.lineTo(5,i+5);
cxt.stroke();
}}
drawRibbon(200,120,navCanvas);
I feel like it has something either to do with the function definition, or the call. Before this script is executed, i create a canvas in the following way:
<canvas id="navCanvas" height="200" width="120">
Why it is not displaying.
View 3 Replies
View Related
Jul 7, 2010
How do I read a local text file line by line, one line at a time. I got upto opening a file, and can read whole file at a time. But I want to read just one line at a time. May be have a counter of lenght of the file and read only the counter number line at a time.
<SCRIPT language=JavaScript>
var fso = new ActiveXObject( 'Scripting.FileSystemObject' );
f = fso.OpenTextFile( "c:\mytextfile.txt", 1 );
[Code].....
View 2 Replies
View Related
Jul 22, 2009
I am trying to design a system that allows users to draw on a whiteboard with different colors, save their drawing into hidden input boxes in the form on the page, then they can click Save Logo to save it to process it through PHP. I have the whiteboard that allows them to draw, but I am lost as to how to get the thing to populate the hidden input boxes.
So, I have the following code:
<HEAD>
</HEAD>
<BODY>
[code]....
What I am trying to do is use the function mousedown(e) to include an event to update a hidden input box with the value of the TD's background color that the hidden input field is attached to, so that it can be tracked when the user hits Save Logo at the bottom of the page. When they hit Save Logo, I want the form to post to itself, go through each of the input hidden fields and capture the color for each table cell, then generate an image based on the generated array, save it to a file on the server with the user's $_SESSION['userid'] as the filename + .jpg.
The problem is, though, that I do not know how to tell JavaScript to do this in the function mousedown(e) code. Also, look in the function table_create and see if I am naming the hidden input boxes correctly; not sure if it will generate the wanted result.
Just a note: I can handle all the PHP handling of the form, I just need help with the Javascript.
Edit: I attached the entire script/page to this post because so many functions rely on each other to operate, and I'm not exactly sure which function will need to be modified to get the desired result. Also, you can copy the code to a .php file to see what it looks like (as that may assist in demonstrating exactly what I'm trying to do, visually).
Edit 2: I suppose what I need to find is how to get the JavaScript to assign a value to the hidden input field that has the same id as the TD field that it needs to be linked to.
View 3 Replies
View Related
Jan 13, 2011
I have a user that insists they have web applications that do this, and wants the one I'm building to do it too...
You have a table on an html form. As the user changes one or more fields in a table row and moves to the next line, the changed row should AUTOMATICALLY be sent back to the server and updated in the database.
If the user moves BACK to a line that's already been changed, and changed a field, a popup should display and ask "if the user really wants to change the field". If so, again, it should AUTOMATICALLY be sent to the server and updated in the database...
Ignoring the horridness of making that many round trips to the server and banging the database for every line, is there a way to AUTOMATICALLY do the equivalent of a submit and post the changed table row back to the php script?
View 3 Replies
View Related
Jun 14, 2006
I would like to know if there exists a javascript library (at least for
IE and Firefox) that let me get css properties in a more structured way.
I would like to have a css value that seperates the size/length value
from the type. For example:
width: 2.5em
size=2.5
type=em
And most importantly I would like a way to convert each such value into
pixels.
Does it exist? I am aware of the CSSStyleDeclaration and related methods
in Firefox.
If not, is it possible to convert such a value as 2.5em into pixels in
javascript? Sometimes the standard available methods that return pixels
cannot calculate the value I need. For example calculating the border size.
View 2 Replies
View Related
Jul 20, 2005
I want to have one statement in my web page that includes a single file (for
example "Mylib.inc" that contains a list of ".js" files to include. Is that possible? And if so can some one show me the basic format to use?
This would allow me to add and remove scripts from my pages without having to edit each page, only w3ouyld need to make a change in the MyLib.inc file I'm envisioning MyLib.inc to look something like this:
<script src="scriptname1.js"></script>
<script src="scriptname2.js"></script>
<script src="scriptname3.js"></script>
<script src="scriptname4.js"></script>
Another thought: Can .css files also be put in there? (probably not huh.) so
i could include everything with one include in my web page?
View 8 Replies
View Related
Nov 20, 2010
How to use reg-ex library in java script
View 2 Replies
View Related
Jan 11, 2007
I know nothing about javascript at the moment, but I've been hitting php very aggressively the past few months.
I've came across a challenge and I'm not sure how to go about fixing it.
Basically, I need to be able to drag an image into a box on my webpage, crop it, and then upload it. I've done basic image uploading and resizing with php. That's no big deal.
The problem is I may want to crop in different spots. The idea is to have some sort of box tool that is set at a given aspect ratio (like Photoshop does). Then, I could select the part of the image I wanted to keep, hit one button that would then crop, resize, and upload the image (storing the pathway to the MySQL database).
So does anyone know of any either standalone GUI's that work well for this sort of image manipulation or possibly a javascript that will allow me to select part of the image and spit out some co-ordinates that I could use with php's GD Library.
View 3 Replies
View Related