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 3435 acoder 16,027
Recognized Expert Moderator MVP
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.
acoder 16,027
Recognized Expert Moderator MVP
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 cool and works, writing the XML
data in a text editor is straightforward for me because I designed the
format. I have no idea however how I can make a simple online drawing
program that creates this XML code. The code is realy simple, just...
|
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 any color (string format #RRGGBB) by using div-tags.
regards
Stefan
###############code starts here#########################
|
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 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.
thanks,
mike
|
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 days! Can anyone
point me to good resources (or implementations) that do this.
Basically is there any way to optimize a boolean expression expressed
in RPN (reverse polish notation)?
I want to implement the algorithm/data structure in C. If you...
|
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).
please let me know any algorithum avialiable for above process.
thanks
Rakesh
| |
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 let me know any algorithm avialiable for above process.
|
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 euler circuit it will output an euler circuit. can any1 give me some starting point or hints ?
thanks for viewing...
|
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 be Java or
ActiveX.
Thank you.
|
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: 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...
|
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...
| |
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,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
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...
|
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
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |