Thread: C++ lineto(); color??

  1. #1
    Registered User
    Join Date
    Sep 2003
    Posts
    55

    C++ lineto(); color??

    Hello,

    so i'm using the lineto(); function to draw somestuff..

    my question is.. how to i change the color of the line..

    i was searching through the help in visual studio .net.. but no good....

    can someone at least point to a resource?

    thanks

  2. #2
    Reverse Engineer maxorator's Avatar
    Join Date
    Aug 2005
    Location
    Estonia
    Posts
    2,318

  3. #3
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    If you are talking about the GDI function LineTo, you need to create a pen with CreatePen and select it into the current hdc with SelectObject. An example is here.

  4. #4
    Registered User
    Join Date
    Sep 2003
    Posts
    55
    thanks for the replies... i think that might help.. but I can't look into it till tomorrow... we'll see how it goes..

    thanks

  5. #5
    Registered User
    Join Date
    Sep 2003
    Posts
    55
    Hello,

    okay so i was trying to run the example, but it's not working out.

    I am using the GDI function lineto().

    But i don't understand why i have to make a pen? and it seems like I can't, i just get errors when I try to create a pen.

  6. #6
    Unregistered User
    Join Date
    Sep 2005
    Location
    Antarctica
    Posts
    341
    CreatePen(), RGB(), SelectObject(), http://msdn.microsoft.com

  7. #7
    Registered User
    Join Date
    Sep 2003
    Posts
    55
    ha!... thanks.. that was a lot easier.. search this search that.. search this.. i like your style..

    thanks

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Critique my lighting model.
    By psychopath in forum Game Programming
    Replies: 4
    Last Post: 08-12-2006, 06:23 PM
  2. egavga.bgi problem
    By sunil21 in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 09-22-2003, 05:06 PM
  3. My opinion on skin color
    By Leeman_s in forum A Brief History of Cprogramming.com
    Replies: 8
    Last Post: 07-11-2003, 12:12 PM
  4. [WinAPI] Developing a color customizable program
    By Templario in forum Windows Programming
    Replies: 6
    Last Post: 02-04-2003, 06:12 PM
  5. Just one Question?
    By Irish-Slasher in forum C++ Programming
    Replies: 6
    Last Post: 02-12-2002, 10:19 AM