Re: Drawing a line - point by point

From: Martin Harvey (Demon Account) (martin_at__nospam_pergolesi.demon.co.uk)
Date: 02/27/04

  • Next message: John Dammeyer: "Delhpi 5 on XP"
    Date: Thu, 26 Feb 2004 23:09:55 +0000
    
    

    On Thu, 19 Feb 2004 15:56:17 -0000, "Roy" <roy@mechnet.liv.ac.uk>
    wrote:

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

    Alas, Alas, you've probably not been searching for the right thing. By
    far and away the fastest alogirhtm is the Bresenham line drawing
    algorithm. which works great for lines with integer start and end
    points. A moore general algorithm, which can be used for more complex
    curves is the midpoint algorithm.

    Try:

    try putting: "line drawing algorithm" into google. The very first
    match I get is:

    http://www.cs.helsinki.fi/group/goa/mallinnus/lines/bresenh.html

    which describes the bresenham alogirhtm.

    MH.


  • Next message: John Dammeyer: "Delhpi 5 on XP"

    Relevant Pages

    • Problem with Gdiapi TestCase 225: LineTO
      ... Lines using a proprietory algorithm. ... drawing lines is not pixel accurate with the GDI Line Drawing Function ...
      (microsoft.public.windowsce.platbuilder)
    • Re: Drawing lines of variable widths
      ... "This version of the demo only supports the drawing of lines in the ... I originally coded the algorithm in 1976, but when I published the web ... This is an easy thing to do when I want to draw a line of zero or no ... The algorithm supports non-integer pen thicknesses. ...
      (comp.graphics.misc)
    • Re: Programmable pulse generator
      ... Bresenham invented famous algorithms for efficiently drawing lines and circles on bitmaps. ... The point here is to realized that the line drawing algorithm can be used for any kind of scaling with factors less than one. ... eps -= Y; ...
      (comp.arch.fpga)
    • Re: Drawing a line - point by point
      ... "Roy" wrote in message ... > I used to have an algorithm for drawing a line pixel by pixel but a ... I think the Bresenham algorithm can help you: ...
      (comp.lang.pascal.delphi.misc)
    • Re: High spped drawing with MFC is it possible?
      ... Data drawing function first calculates the location of point on screen ... algorithm so that it first determines whether a point overlaps other points ...
      (microsoft.public.vc.mfc.docview)