Keep the 'Line'

This is a discussion on Keep the 'Line' within the Windows Programming forums, part of the Platform Specific Boards category; I have written a program that implements the VK_UP, DOWN, RIGHT, LEFT keys and also it works with MoveToEx and ...

  1. #1
    the Corvetter
    Join Date
    Sep 2001
    Posts
    1,584

    Keep the 'Line'

    I have written a program that implements the VK_UP, DOWN, RIGHT, LEFT keys and also it works with MoveToEx and LineTo functions. Well, I got the 'Line' to move all around the screen, but now I have another question:

    When the line moves to the next spot (determined by the key pressed), I want to keep the previous line there so it almost looks as though it is a drawing tool. How would I do this? Thanks.

    --Garfield
    1978 Silver Anniversary Corvette

  2. #2
    Registered User johnnie2's Avatar
    Join Date
    Aug 2001
    Posts
    186
    Keep a memory of a certain number of previous point coordinates with which to draw your line as it is being moved. You could use queues for a fixed number or something along the lines of a linked list or vector if you wanted to dynamically change the number of points stored.
    "Optimal decisions, once made, do not need to be changed." - Robert Sedgewick, Algorithms in C

  3. #3
    the Corvetter
    Join Date
    Sep 2001
    Posts
    1,584
    I was thinking more along the lines of a memory hdc or something. You know when you write to a hdc, well I just want to keep the line written to the device context. Thanks.

    --Garfield
    1978 Silver Anniversary Corvette

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to do encryption in C
    By sankarv in forum C Programming
    Replies: 33
    Last Post: 12-28-2010, 11:01 AM
  2. Reading a file line by line
    By Raskalnikov in forum C Programming
    Replies: 8
    Last Post: 03-19-2009, 12:44 AM
  3. Pointer and Polymorphism help.
    By Skyy in forum C++ Programming
    Replies: 29
    Last Post: 12-18-2008, 09:17 PM
  4. Printing Length of Input and the Limited Input
    By dnguyen1022 in forum C Programming
    Replies: 33
    Last Post: 11-29-2008, 04:13 PM
  5. Finding carriage returns (\c) in a line
    By JizJizJiz in forum C++ Programming
    Replies: 37
    Last Post: 07-19-2006, 06:44 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21