Hey there, well firstly i'm a college student studying a diploma in software development. In my assignment i am asked to write a program that is like an IQ test. My program is finished, but i decided to add a high scores section to it at the end, to try gain extra marks. I used the bitmap creation tool on Microsoft Visual C++ 6.0 to create a picture of a trophy with the number 1 on it. I would create two more bitmaps with 2 and 3 on them for the purpose of the high score.
On to my problem:
I dont know how to add an image to a C++ program and i cant find the help i need anywhere on the internet. Could someone possibly talk me through adding an image to a program step by step?
I am by no means asking you to do the assignment for me, i just would like to know how to actually put in the image.
If its relevant to you helping me, the image is called "Cup1.bmp" and is in the same folder as the program is.
Thanks in advance, Ian.
6 10066
First of all u need to create a resource file.. A resource file has .rc xtension.. then u need to add the resource file into u r project.. after that go to view-->resource view in Visual studio.. then xpand the resource file there u can c bitmaps folder.. after that right click on the bitmap then insert bitmap..
May b this helps u..
Xoinki
Hi there, i tried to do what you said. It managed to create an .rc file, but i am unclear what to do now with it. The code inside the resource file is exactly this:
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by Bitmap.rc
//
#define IDB_BITMAP1 101
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 102
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1000
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
It uses a file called "bitmap1" that i created temporarily to see if it would work.
How i did all this was:
1. In Visual C++ 6.0, i went to insert>resource
2. I highlighted bitmap then clicked import and selected my bitmap
3. I then went to view>resource includes
4. It brought up a small screen with the following information
Symbol header file:
resource.h
Read-only symbol directives:
#include "afxres.h"
Compile time directives:
[ nothing was written here ]
5. I then pressed ok, and that is where i am up to.
6. I did compile the program to see what it would do after entering the #include "afxres.h" where the libraries usually go at the top of the page.
Can you tell me what to do from now, or any mistakes i have made so far.
Thanks again for your help, Ian.
Can anyone help me?
I've been thinking, would i have to create a whole new project for it to work? Because all the code so far is in a single .cpp file
I'm relatively new to C++ and only been reading up on classes today, but i think i've got the hang of them.
As long as you can explain it in simple terms i will be able to do what you tell me, or research on how to do it.
Thanks again, Ian.
How come everyone else seems to get help, except me :(
Do i smell funny or something?? I just washed 5 days ago, surely not time for another one yet??
Just kiddin' please help :D
Sign in to post your reply or Sign up for a free account.
Similar topics
by: D. Alvarado |
last post by:
Hello,
Can anyone recommend a good image scaling program for PHP 4. What
I'm really looking for is just a function that takes an image file and
a width to which to scale the image and outputs the...
|
by: Michael Robbins |
last post by:
Please pardon me if this question is common; I didn't see an answer.
I have access to a MS Excel Add-In but I want to use the functions
from within my Visual C++ code.
Can I do this? How?
|
by: royzeb |
last post by:
Hi, I've got a simple vc++ program that basically just runs a daemon in
the background and sends update messages to a logfile as it goes along.
What I'd like to do is see these log messages also...
|
by: khaleel.alyasini |
last post by:
Hello sirs & madams,
I'm currently working on DCT compression algorithm as my project. My
knowledge on C++ and DSP is rather weak/moderate. I was wondering if
any could help me and teach me the...
|
by: kuiyuli |
last post by:
I'm using VC++ .Net to do a simlple program. I tried to use <vector>
<list> in the program, and I simply put the folowing lines
"
#include <list>
#include <vector>
#include <string>
using...
|
by: SagharAyyaz |
last post by:
Hi all, I am new to google groups.
I want to copy files from Windows to Linux Server through VC++
program. Can any body help me? I don't know, am I in the right group or
not but hopefully I...
|
by: stonny |
last post by:
Hi, I am converting my matlab program into C/C++. I need to change some
image processing toolbox functions into C/C++, such as edge detection,
mathematical morphology.
Is there any place that I...
|
by: ranishobha21 |
last post by:
Hello,
i have a program written in VC++ using MFC.i want this program to be
available on WWW.can any one suggest how can i make it.
Is there any tools in visual studio so that i can easily...
|
by: =?Utf-8?B?S3VlaXNoaW9uZyBUdQ==?= |
last post by:
I have a .NET VC++ program, I want to execute some dos command from the
program, e.g. copy some file, and etc. How do I do that?
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |