Drawing a line - point by point

From: Roy (roy_at_mechnet.liv.ac.uk)
Date: 02/19/04


Date: Thu, 19 Feb 2004 15:56:17 -0000

Hi,
     I used to have an algorithm for drawing a line pixel by pixel but a
lengthy search has yielded nothing.

What I need is a routine to calc each pixel for a line between points x1,y1
and x2,y2

Can anyone help?

Thanks,

Roy.



Relevant Pages

  • Re: How to store relative position
    ... drawing area out 50%, and I paint a dot, then zoom the drawing ... For example, if your drawing area is meant to represent a full US Letter Size page then it treats the displayed drawing area as being 8.5 units wide and 11 units high at all times, regardless of the current physically displayed pixel width and height. ... That is exactly how the VB will treat your PictureBox drawing area if you ignore its current physically displayed size and set its ScaleWidth to 8.5 and its ScaleHeight to 11, as has already been suggsted to you by a number of people who have posted reponses to your question. ...
    (microsoft.public.vb.general.discussion)
  • Re: CDC problem
    ... GDI+ although it would support float has to round it of to the nearest pixel ... There is no concept of float pixel or partial whatever library we choose. ... >> I am using CDC member functionsfor drawing ...
    (microsoft.public.win32.programmer.gdi)
  • Re: Problem with vista and form appearance
    ... When drawing single pixel thickness lines then the final pixel of the line is not actually plotted. ... This applies both when drawing using the native VB Line method and when drawing using the alternative API LineTo method. ... Again this behaviour is by design, and one of the reasons for it is so that continuous lines which are drawn by repeatedly using the Line method to draw from the end of the previous line to some new position, etc, etc all get drawn properly. ... The rationale behind it is to prevent the last pixel of each line segment being plotted twice, once as the last pixel of the first line segment and once again as the first pixel of the following line segment. ...
    (microsoft.public.vb.general.discussion)
  • Re: Make edges smooth after cliping.
    ... Drawing that uses antialiasing attempts to hide the alias effects of the basic pixel resolution of the output device by drawing on pixels that are outside of the shape and creating an average colour containing a mix of the origianal and new colours. ... Clipping on the other hand, is a mechanical process of including or excluding pixels from a certain area. ... After this code execution i get clipped image. ...
    (microsoft.public.dotnet.framework.drawing)
  • Re: Drawing a line - point by point
    ... > I used to have an algorithm for drawing a line pixel by pixel but a ... Alas, Alas, you've probably not been searching for the right thing. ... far and away the fastest alogirhtm is the Bresenham line drawing ...
    (comp.lang.pascal.delphi.misc)