Thread: How can i import a picture?

  1. #1
    Registered User
    Join Date
    Jan 2006
    Posts
    21

    How can i import a picture?

    How can i import a picture in Visual C++ Express Edition,
    Because in tutorials it's not obvious how to do that...
    Please help!

  2. #2
    Registered User
    Join Date
    Jan 2006
    Posts
    21
    Can someone please answer???
    I want to know how to import a picture in win32...

  3. #3
    Registered User
    Join Date
    Aug 2005
    Posts
    1,267
    Well, if you would post your question on the Windows Programming board you MIGHT get an answer.

  4. #4
    Supermassive black hole cboard_member's Avatar
    Join Date
    Jul 2005
    Posts
    1,709
    You could also try to NOT be so vague.
    Import a bitmap in the IDE to drag and drop onto a form or import a bitmap at runtime?
    Good class architecture is not like a Swiss Army Knife; it should be more like a well balanced throwing knife.

    - Mike McShaffry

  5. #5
    Registered User
    Join Date
    Jan 2006
    Posts
    21
    Well i don't know how it really works.. but i want it to get in the source code.. BEFORE runtime...
    sorry that i'm so vague

  6. #6
    Supermassive black hole cboard_member's Avatar
    Join Date
    Jul 2005
    Posts
    1,709
    I've got no idea what you mean, unless you mean you want to load a bitmap while editing a form and drag & drop it on...
    Good class architecture is not like a Swiss Army Knife; it should be more like a well balanced throwing knife.

    - Mike McShaffry

  7. #7
    Registered User
    Join Date
    Jan 2006
    Posts
    6
    He means that when he runs his program you get:

    http://www.cprogramming.com/cprog.gif <<< this must be an image...

    Hi this is a test program from cprogramming.com

  8. #8
    Registered User
    Join Date
    Jan 2006
    Posts
    21
    Look here is my source code:
    Code:
    if(action==1)
       {
       int lvl, hp, battle, attacke;
       string mname;
       lvl = rc;
       rc = (rand() % (6 - 0 + 1) + 0);
       int monc;
       monc = rc;
       if(monc==1)
       {
    	   lvl=(lvl+10);
    	   mname = "dark elf";
    	   attacke = 10;
       }
       if(monc==2)
       {
    	   lvl=(lvl+8);
    	   mname = "white wolf";
    	   attacke = 13;
       }
       if(monc==3)
       {
    	   lvl=(lvl-3);
    	   mname = "goblin";
    	   attacke = 7;
       }
       if(monc==4)
       {
    	   lvl=(lvl-4);
    	   mname = "evil bird";
    	   attacke = 6;
       }
       if(monc==0)
       {
    	   lvl=(lvl+1);
    	   mname = "thief";
    	   attacke = 3;
       }
       if(monc==5)
       { 
    	   lvl=(lvl+3);
    	   mname = "kremling";
    	   attacke = 7.5;
       }
       if(monc==5)
       {	
    	   lvl=(lvl-8);
           mname = "wasp";
    	   attacke = 1;
       }
    I just a picture per monster in my win 32 application..
    Can anyone help?

  9. #9
    Registered User
    Join Date
    Aug 2005
    Posts
    1,267
    add the bitmap to the resource file and call LoadBitmap() win32 api function, or maybe call win32 api CreateBitmap(). See MSDN for both functions.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. What's an import library?
    By chiefmonkey in forum C++ Programming
    Replies: 1
    Last Post: 06-19-2009, 05:00 PM
  2. [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
  3. import address table (IAT)
    By George2 in forum C++ Programming
    Replies: 5
    Last Post: 02-20-2008, 08:01 AM
  4. File import opinion.
    By Kennedy in forum Tech Board
    Replies: 2
    Last Post: 09-22-2006, 05:52 PM
  5. How To Import A Bitmap Picture Correctly Using Visual C++ 6 ?
    By SonicWave in forum Windows Programming
    Replies: 2
    Last Post: 09-16-2001, 09:28 AM