473,657 Members | 2,758 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

draw lines and polygons

13 New Member
Hi All,

Since two days Ive been trying to draw lines and polygons interactively (using mouse clicks), but all ive found is some libraries that draw shapes using predefined cooredinates.

Ive also been trying to search for books on amazon that would help me learn more about this, but looks like I'm not using the right search terms...

Any pointers, examples or related links would be greatly appreciated.

Thanks a lot!
Apr 6 '07 #1
1 2631
acoder
16,027 Recognized Expert Moderator MVP
See http://www.walterzorn.com/jsgraphics/jsgraphics_e.htm

As for mouse clicks, add an onclick event handler which detects mouse clicks:
Expand|Select|Wrap|Line Numbers
  1. window.onclick=myfunction;
Apr 9 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
2054
by: David | last post by:
i am using the imagepolygon function to create a shape on an image i have, however i want to put more than just one polygon onto this image, i have no idea how to do this. Do i have to call the imageploygon function each time i want to add something to the image? All help is appreciated. Thanks Dave
1
3338
by: smjmitchell | last post by:
Hi All, I am developing a application in VB 6.0. I need to plot a 3D mesh of quadrilateral and triangular polygons. I have this working OK in wireframe. The question I have is what is the easiest way to shade the polygons so that I can render the surface. Each polygon is defined by the coordinates in space of its corners. Initially I would be happy with a uniform shading (i.e. constant color) and that is really what I am asking for help...
9
11030
by: Max M | last post by:
I am using PIL to generate som graphs, like: draw = ImageDraw.Draw(im) for graph in self.graphs: polygon = graph.getPolygon() draw.polygon(polygon, outline=graph.color) del draw But the linewidth of my polygon is only one pixel wide. Is there any way to set it to something else?
2
2493
by: Matt | last post by:
I am writing a recursive program to draw the lines recursively, given the range and number of intervals (n) between the range. The problem is I don't know how to draw the line in point 0.375, as you see below. Please advise! Thanks! #include <iostream> using namespace std;
21
3065
by: DraguVaso | last post by:
Hi, I have an inherited DataGrid, that does lots of extra stuff. For exemple drawing a backgroundimage in every cell. The problem is that it's taking too much time (using gdi+), so I want to do it using DirectX. I downloaded already the DSK etc, but I can't find how I need to draw an image on a given position. I don't need stuff to write advanced 3D-games, just painting that image. Can anybody help me with this? I'm already looking for...
2
2343
by: Klaus Jensen | last post by:
Hi! I need an ASP.net control, which makes it possible for the user to define imagemaps. I show an image, the user can define areas (polygons would be nice, but just rectangles is ok), and I can access these areas, save them and use them to generate imagemaps. It is to be used with maps, where the client can add information to areas of
10
4622
by: wazzup | last post by:
C++ is new to me and I'm trying solve this problem but get stuck. Please help me out. Below is the task and after that is what i got so far. Create a program to print nested squares Input: Accept the width of the largest square Output: A series of nested squares with 1 space between them Sample: > eca4.exe 10 ********** * * * ****** *
9
4019
by: zhaow | last post by:
Hi, All Greetings! I want to develop as appllication that requires a line-drawing function in the blank area between two forms. I have looked up the MSDN, it says that a graphics object need a reference to a control or a form. I guess it means that lines can't be draw on blank area between two forms. Can anybody guarantee this for me? Is there any method can realize this function? I mainly want to draw a line from a button in form1 to...
8
2299
by: Anuhas | last post by:
Dear experts, I have used buttons to indicate certain locations on a map.(Just a picture used as form background) I am going to draw lines interconnecting these buttons(locations). But I dont know how to draw lines connecting those buttons. Can I draw lines using coordinate systems? Please help me soon to solve this problem.
0
8385
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
8303
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8723
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
8502
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
8602
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...
1
6162
isladogs
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...
0
4150
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...
0
4300
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1601
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.