Thread: outputting picture

  1. #1
    Registered User wayko's Avatar
    Join Date
    Sep 2001
    Posts
    28

    Cool outputting picture

    ok here is a simple question....
    i have a program that asks for the year you are born if you were born bc or ad... now if someone is born the same year as i am i output you are blah blah we are the same age....i would like that when a person enter the info a picture pops up is there a way to do that?
    hello its me Wayko

  2. #2
    _B-L-U-E_ Betazep's Avatar
    Join Date
    Aug 2001
    Posts
    1,412
    are you doing windows programming or console programming? Or 16 bit dos programming? What operating system? What compiler? Can we see any of your code... like the section where you want the pop-up to occur?

    Short answer... yes you can. You can probably do it with a message box... but it depends what you are doing and how advanced you are getting with it.
    Blue

  3. #3
    Frustrated Programmer :( phantom's Avatar
    Join Date
    Sep 2001
    Posts
    163
    Easiest way to do it would be using a dialog box..

  4. #4
    Registered User wayko's Avatar
    Join Date
    Sep 2001
    Posts
    28

    Talking

    its a dos program

    i am using visual c++ 6.0

    this is the code

    #include <iostream.h>
    #include <string>
    int main ()

    {
    int year;
    cout << "Enter the year you were born:";
    cin >> year;

    int factor;
    factor = 2001;

    int age;
    age = factor - year;

    int bc;
    bc = factor + year;

    char christ = NULL;

    {
    cout << "Enter if you were you born before or after christ...\npress [b] for before [a] for after then press enter : " ;
    cin >> christ;
    }

    if (christ == 'b' || christ == 'B')
    {
    cout << " You are " << bc<<" years old";
    }
    else if (christ == 'a' || christ == 'A')
    {
    cout << " You are " << age <<" years old";
    }
    if (bc > 27 && christ == 'b' || christ == 'B')
    {
    cout << " you are "<< bc - 27 <<" Years older than me... "; //would like a picture pop up here.

    }
    else if (age > 27 && christ == 'a' || christ == 'A')
    {
    cout << " you are "<< age - 27 <<" Years older than me... "; //would like a picture pop up here.

    }
    else if (age < 27)
    {
    cout << " You are " << 27 - age <<" Years younger than me..."; //would like a picture pop up here.

    }
    else
    {
    cout << " We are the same age"; //would like a picture pop up here.

    }

    return 0;

    }
    Last edited by wayko; 09-25-2001 at 05:42 AM.

  5. #5
    Frustrated Programmer :( phantom's Avatar
    Join Date
    Sep 2001
    Posts
    163
    ooops......
    My site to register for all my other websites!
    'Clifton Bazaar'

  6. #6
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,130
    >its a dos program
    >i am using visual c++ 6.0

    Then it's not a DOS program. It's a console program.
    The console is the window that looks like DOS.

    As a short, simple answer: no, there is no way.

    You could write a real DOS program and display graphics there.
    Or you could write a normal windows program and display
    the graphics there. I wouldn't try graphics in a real DOS
    environment, it's way outdated. I wouldn't try windows GUI
    programming, it's far to difficult just yet. Just go on programming
    and learning. Graphics in C/C++ are not easy.
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

  7. #7
    Registered User wayko's Avatar
    Join Date
    Sep 2001
    Posts
    28

    Unhappy

    graphic are not easy at all but i will continue learning and then one day i will be able to program final fantasy 20 <--- being realistic ...

    so how do i start working with opengl and other things like that?
    Last edited by wayko; 09-25-2001 at 12:36 PM.
    hello its me Wayko

  8. #8
    Frustrated Programmer :( phantom's Avatar
    Join Date
    Sep 2001
    Posts
    163
    OpenGL is what I am currently learning. The best web site to learn is http://nehe.gamedev.net/ The site also has a forum board for questions.
    With openGL, graphics are very easy to use once you have learnt it (like every other language on this planet), but I make a lot more errors programming in openGL than I do with normal C++ code. OpenGL is a lot more trial and error.

    Games made in openGL include (and I may be wrong here) -> Rollercoaster tycoon & theme park world

    Bottom line -> openGL is great
    My site to register for all my other websites!
    'Clifton Bazaar'

  9. #9
    Registered User wayko's Avatar
    Join Date
    Sep 2001
    Posts
    28

    Talking

    thanx for the info ñ_ñ
    hello its me Wayko

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. [C] change picture width and height in Static control (no MFC)
    By pc2-brazil in forum Windows Programming
    Replies: 1
    Last Post: 05-05-2008, 01:17 AM
  2. Insert A Picture into C++
    By SweeLeen in forum C++ Programming
    Replies: 3
    Last Post: 03-07-2006, 05:52 AM
  3. Embedding Objects into Picture Controls
    By Capsher Codah in forum Windows Programming
    Replies: 1
    Last Post: 03-05-2005, 09:38 PM
  4. Rotating a picture
    By Bill in forum C Programming
    Replies: 4
    Last Post: 05-18-2004, 09:26 PM
  5. Insert picture for printing
    By ooosawaddee3 in forum C Programming
    Replies: 0
    Last Post: 04-05-2002, 09:26 PM