Thread: Color in grafics...

  1. #1
    I love C....i guess :-)

    Color in grafics...

    I learning about creating grafics in C..
    I made a triangle:
    void _triangle(int xstart, int ystart, int xend, int yend, int xtop, int ytop)
    sline(xstart, ystart, xend, yend);
    sline(xend, yend, xtop, ytop);
    sline(xtop, ytop, xstart, ystart);

    But how do i get the triangle filled med the color Red or Yellow, and i got some others grafics, which I liked to be filled with some colors..
    But how can i make that...

  2. #2
    Registered User
    Join Date
    Oct 2001
    What compiler and what graphics lib are you using?

    (Depending upon your answer I may recommend switching to using Allegro as the lib. It is free, powerful, and very easy to learn. Supports all color depths (32-bit or less), all video card supported resolutions, bitmap loading and blitting, everything else graphically related really, sound, input devices (like keyboard, mouse, and joystick), etc.......

    See this post for an example program.

    Allegro is cross platform (Windows, Linux, BeOS, DOS, etc) and works with Dev-C++ (mingw), MSVC, DJGPP, Borland's free 5.5 compiler, and many others.

    No, I don't work for anybody related to it, just think it is a wonderful artistic tool. It is giftware, so no worries about using it for any kind of project you like. See my sig for graphical installers for the lib.

    Allegro precompiled Installer for Dev-C++, MSVC, and Borland:

  3. #3
    I love C....i guess :-)
    I'm using Borland 5.02 til windows.
    Have windows XP.
    I have heard about a funktion called fill or filled., which can paint color in a sq. or triangle...
    Have anybody heard about that..

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. advanced grafics
    By urban in forum C++ Programming
    Replies: 2
    Last Post: 06-02-2005, 12:28 PM
  2. offscreen grafics port?
    By Unregisterred in forum Windows Programming
    Replies: 5
    Last Post: 09-26-2002, 06:22 AM
  3. grafics
    By c++.prog.newbie in forum Game Programming
    Replies: 1
    Last Post: 11-01-2001, 11:42 PM