473,325 Members | 2,608 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

Line drawing algorithm

Can any one please suggest me a algorithm to draw horizontal and
vertical line between two points (a right angled line, not a slant
line).

Jul 26 '06 #1
4 2530
For now it looks like to me you would just want to draw from x1,y1 to x2,y1
and then to x2,y2 ? If not that simple, please elaborate a bit about what
you are trying to do....

--
Patrice

<ra***********@gmail.coma écrit dans le message de news:
11**********************@75g2000cwc.googlegroups.c om...
Can any one please suggest me a algorithm to draw horizontal and
vertical line between two points (a right angled line, not a slant
line).

Jul 26 '06 #2
Hello Patrice,

thanks for reply.

i need to draw Stepped line between two points (x1,y1) and (x2,y2) with
x1 not equal to x2, (i don't want to draw slant line). (as links drawn
between blocks in many graphical editor).

Jul 26 '06 #3
Ok so the basic response should be a start i.e. the principle I mentionned
will draw an horizontal line from the first point to the x coordinate and
then a vertical line to the second point.

Then you can ehance this a bit depending on what you are after (for example,
the start or destination point could be moved by the user as long as it is
inside the shape, or you could let the user move the corner point, or add
adtional points etc.. but basically the idea is just to move from one point
ot the next by changing one of the coordinates so that you draw only
vertical or horizontal lines...

--
Patrice

<ra***********@gmail.coma écrit dans le message de news:
11*********************@i3g2000cwc.googlegroups.co m...
Hello Patrice,

thanks for reply.

i need to draw Stepped line between two points (x1,y1) and (x2,y2) with
x1 not equal to x2, (i don't want to draw slant line). (as links drawn
between blocks in many graphical editor).

Jul 26 '06 #4
Hi Patrice

Thanks a lot,

I will try out......

Jul 27 '06 #5

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

Similar topics

5
by: C. Alexander | last post by:
I'm making a 'whiteboard' application. I'm trying to have 2+ connected users able to draw at the same time. However, if User1 draws a line, when User2 is drawing, on User1 screen, it will draw...
8
by: Andrew Poulos | last post by:
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? ...
9
by: Steve Long | last post by:
Hello, (total GDI newbie) I'm having trouble drawing just a simple line to display in a picturebox. I just want a straight, dotdash line. I have two methods, one works and one doesn't (it cause...
3
by: Robert W. | last post by:
Long ago I developed a simple algorithm for calculating how much space is required to display a multi-line label in a limited width. It seemed to be working okay but then my testing revealed a...
2
by: Martijn Mulder | last post by:
I want to know if the mouse is over (hitting) a line. Therefore I created a Region object that holds the line and use the IsVisible() method to test if the mouse hits the line. It doesn't work! In...
13
by: Martijn Mulder | last post by:
I try to define a line with the length of 1 unit (1 pixel) that is, in fact, just a point on the screen. But when I draw it with a wide pen with the appropriate StartCap and EndCap (Round), it will...
3
by: Evo | last post by:
Below is my code,it passed the compile and link under TC2.0 correctly. But the line it draws is obviously wrong. I think it's somewhere I thought wrong. But I really can't find it out. Can someone...
2
by: koolest1 | last post by:
Here's a code for scan conversion of a line using DDA algorithm.... but i guess there's some problem in the sense that not every kind of line is getting plotted properly (at least that's what i...
12
by: Petra Rohmer | last post by:
Hello, I want to ake following 0,0 (900mm,900mm) -------------------------------------- |....................................| |....................................|...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
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 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.