Am new to javaScript.
Am trying to draw circuits in JavaScript. I have problem with drawing the arcs in the AND & OR logic gates
Can any body help me to do this?
Am using IE6.0. it's not supporting canvas. fillArc() method of JavaScript is also not working. -
-
<HTML>
-
<head>
-
<script type="text/javascript" src="wz_jsgraphics.js"></script>
-
-
</head>
-
<body>
-
-
<div id="first"></div>
-
<script type="text/javascript">
-
function d()
-
{
-
a.drawLine(105,120,105,400);// LINE FOR A
-
a.drawString("A'",120,100);
-
a.drawLine(105,130,125,130);//LINE CONNECTING A AND A'
-
a.drawLine(125,130,125,140);// LINE from A' PROCEEDING TO NOT GATE
-
a.drawLine(115,140,135,140);// STRAIGHT LINE PART OF NOT GATE
-
a.drawLine(115,140,125,150);//LEFT LINE OF NOT
-
a.drawLine(125,150,135,140);// RIGHT LINE OF NOT
-
a.drawEllipse(120,150,10,10);
-
a.drawLine(125,160,125,400); // LINE FOR A'
-
a.drawString("B",160,100);
-
a.drawLine(165,120,165,400);// LINE FOR B
-
a.drawString("B'",180,100);
-
a.drawLine(165,130,185,130);//LINE CONNECTING B AND B'
-
a.drawLine(185,130,185,140);// LINE from B' PROCEEDING TO NOT GATE
-
a.drawLine(175,140,195,140);// STRAIGHT LINE PART OF NOT GATE
-
a.drawLine(175,140,185,150);//LEFT LINE OF NOT
-
a.drawLine(185,150,195,140);// RIGHT LINE OF NOT
-
a.drawEllipse(180,150,10,10);
-
a.drawLine(185,160,185,400); // LINE FOR B'
-
a.drawLine(105,170,230,170);//line extending from A for AB
-
a.fillEllipse(104,169,4,4);//point denoting A in AB(and gate)
-
a.drawLine(165,190,230,190);//line extending from B for AB
-
a.fillEllipse(164,189,4,4);//point denoting B in AB(AND gate)
-
a.drawLine(230,165,230,195);//line joining A and B in AND gate
-
//a.fillArc(230,165,30,30,0,60);
-
a.drawRect(230,165,30,30);
-
var Xpoints = new Array(10,30,20,10);
-
var YPoints = new Array(10,10,20,10);
-
a.drawPolyline(Xpoints,YPoints);
-
var Xpoints1 = new Array(300,320,310,300);
-
var YPoints1 = new Array(300,300,310,300);
-
a.drawPolyline(Xpoints1,YPoints1);
-
var a1=500;
-
var b1=500;
-
var c,d=0;
-
/*for(c=1;c<=20;c++)
-
{
-
a.drawEllipse(a1,b1,1,1);
-
if (c<10)
-
{
-
a1=a1+5;
-
b1=b1+5;
-
}
-
if(c==10)
-
{
-
if(d<=8))
-
{
-
a1=a1-1;
-
b1=b1;
-
d=d+1;
-
}
-
}
-
else
-
{
-
a1=a1-1;
-
b1=b1+1;
-
}
-
c=c+1;
-
}*/
-
a.paint();
-
}
-
var a=new jsGraphics();
-
var b=new jsGraphics("first");
-
d();
-
</script>
-
</body>
-
</html>
-
Thanking u in anticipation
Maha
3 3422
Have you tested in other browsers?
Is it just the arcs that you can't get working?
NO i just tried in IE6.0.
This is for my examination sake. My college lab computers have only IE6.0. Hence am forced to do in IE6.0
If there is no such restriction, then I can use any other browser such as opera. I tried to use canvas (HTML5). IE6 is not supporting canvas.
That is very poor on the part of the college for not offering a choice, not teaching students to program cross-browser, and at the very least not upgrading.
Try the examples on the website where you got the library script from. Do they work in IE6?
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Remon Huijts |
last post by:
Hi there,
For a very specific service, I have created a PHP script that uses the GD
library functions to create a PNG image from a few lines of XML data
describing a simple diagram/drawing. It's...
|
by: Stefan Burger |
last post by:
Those of you who are in need for drawing vector lines might be interested in
the following code.
DrawLine( x1, y1, x2, y2, color ) draws a vector line from any Point x1,y1
to any Point x2,y2 in...
|
by: Mike Edwards |
last post by:
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...
|
by: webposter |
last post by:
Hi,
I am looking for information on a data structure (and associated
algorithm) to do short-circuit evaluation of boolean expressions and
haven't found a single one even after googing for two...
|
by: rakesh.Mysore |
last post by:
hi
Currently am working on project which have graphical editor for circuit
diagram which involve validation of circuit and logic flow in circuit
diagram.(process diagram from left to right).
...
|
by: pranesh.nayak |
last post by:
Currently am working on project which has graphical editor for circuit
diagram which involve validation of circuit and logic flow in circuit
diagram.(process diagram from left to right).
please...
|
by: luna18 |
last post by:
i like to do programming but i am not a computer student.. =)
i m trying to write a program to determine a euler circuit.but end up all stuck...
i tyr to take the input as graph and if it is a...
|
by: javelin |
last post by:
I need to be able to create a javascript based drawing/signature box,
and be able to save it. Can someone refer me to a script that will
allow this, or even a 3rd party package for sale? It can't...
|
by: serave |
last post by:
Hi i'm new in this group. I need some help with php. I need to draw
any mathematical function i get through a form?
Please help me
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
| |