Thread: Pixel...

  1. #1
    i dont know Vicious's Avatar
    Join Date
    May 2002
    Posts
    1,200

    Question Pixel...

    How would I go about making a pixel to come up on the screen and change its color and size?

    Like to make sprites or Galaga type ships?

    I cant seem to use Graphics.h in windows for some reason so I need to know what procedures or downloads i need to make to accomplish my goal.
    What is C++?

  2. #2
    i dont know Vicious's Avatar
    Join Date
    May 2002
    Posts
    1,200
    Oh come on...
    Someone has to know this!!!
    What is C++?

  3. #3
    Registered User
    Join Date
    Apr 2002
    Posts
    1,571
    So, you're using Win32 API? You can't change the size of a pixel, it is always a pixel. If you want to output one use the function SetPixelV( HDC, INT, INT, COLORREF );

    something like this
    SetPixelV( hdc, x, y, RGB( 255, 255, 255 ) );

    The RGB is a macro you can use to determine color of a pixel. 0 - 255 for each. If you want sprites, just make them in paint as a BMP and load the image to a HBITMAP and blt it to the screen. I don't know how much you know so, just ask more questions.

  4. #4
    i dont know Vicious's Avatar
    Join Date
    May 2002
    Posts
    1,200
    NO!!!

    Im doin Console Apps....
    What is C++?

  5. #5
    Registered User
    Join Date
    Apr 2002
    Posts
    1,571
    Oh sorry. Like mode 13h or something? I don't have much experience in console graphics. Sorry.
    "...the results are undefined, and we all know what "undefined" means: it means it works during development, it works during testing, and it blows up in your most important customers' faces." --Scott Meyers

  6. #6
    i dont know Vicious's Avatar
    Join Date
    May 2002
    Posts
    1,200
    I dunno...

    I just try to compi;e a normal console app and it says BGI graphics not supported under windows???????

    Thx for you help anyway Mr. Wizard
    What is C++?

  7. #7
    Registered User JoshG's Avatar
    Join Date
    Mar 2002
    Posts
    326

    console doesnt do graphics

    You can't make a console program with graphics. You will either have to make a DOS program or a Windows program. You should check out Allegro or find out about mode13h.

  8. #8
    Code Warrior
    Join Date
    Nov 2001
    Posts
    669
    As far as I know you can't use MODE 13h in win32 console mode application.
    Current projects:
    1) User Interface Development Kit (C++)
    2) HTML SDK (C++)
    3) Classes (C++)
    4) INI Editor (Delphi)

  9. #9
    Registered User
    Join Date
    Dec 2001
    Posts
    479
    you are using borland right?

    if u arent u cant compile that

    anyway your compiler knows about it so u must be using borland

    what u must do is to open a new project.

    in the project path and name, make it so u save your file in your

    bgi folder and the platform must be DOS not windows click on the

    library

    BGI and then click ok

    i'm using borland 5.0

  10. #10
    l'Anziano DavidP's Avatar
    Join Date
    Aug 2001
    Location
    Plano, Texas, United States
    Posts
    2,743
    BGI is a Borland DOS graphics mode...if you need help with it...then personally email me and I will help you. I have experience with it.
    My Website

    "Circular logic is good because it is."

  11. #11
    i dont know Vicious's Avatar
    Join Date
    May 2002
    Posts
    1,200
    Whats wrong...

    Code:
    #include <iostream.h>
    #include <graphics.h>
    
    int GraphDriver;
    int GraphMode;
    
    int main()
    {
    	initgraph ( &GraphDriver, &GraphMode, "" );
    
       circle ( 5, 5, 10 );
    
       cin.get();
       return 0;
    }
    it is saved in BGI folder and itsays Make failed, and gives no reason.
    What is C++?

  12. #12
    Rambling Man
    Join Date
    Jan 2002
    Posts
    1,050
    Are you sure you're using Borland?

  13. #13
    i dont know Vicious's Avatar
    Join Date
    May 2002
    Posts
    1,200
    Yup

    Borland C++ 5.02

    I know its wierd. Could Win98 have anything to do with it?

    What is C++?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Changing pixel colour
    By redruby147 in forum C Programming
    Replies: 11
    Last Post: 06-09-2009, 05:28 AM
  2. How can I make this code more elegant?
    By ejohns85 in forum C++ Programming
    Replies: 3
    Last Post: 04-02-2009, 08:55 AM
  3. Reading pixel color data from screen
    By JJFMJR in forum Windows Programming
    Replies: 8
    Last Post: 08-22-2008, 12:27 PM
  4. Getting Pixel Colour Screen
    By god_of_war in forum C++ Programming
    Replies: 3
    Last Post: 03-14-2006, 01:17 PM
  5. Green Pixel On My Screen???
    By (TNT) in forum A Brief History of Cprogramming.com
    Replies: 18
    Last Post: 01-21-2002, 08:09 AM