954,499 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

displaying an image file

Hello,

I need to write a program which displays some images on the screen depending on some calculations. For example if the result of the calculation is 3 it will display an image file, if it is 5 it will display another image file.

I don't even know where to start. Could you please lead me the way. Maybe a link or a book to study?

kedi
Newbie Poster
4 posts since Feb 2008
Reputation Points: 10
Solved Threads: 0
 
Colin Mac
Posting Whiz
327 posts since Sep 2006
Reputation Points: 78
Solved Threads: 22
 

Say the type of your image file. Then we will talk...

zhelih
Junior Poster
114 posts since Sep 2007
Reputation Points: 9
Solved Threads: 11
 
Say the type of your image file. Then we will talk...

ok, let me be more specific...

i need to read some information from a text file, make some calculations and comparisons on them, then depending on the results i need to display one of three .bmp images on the screen...

kedi
Newbie Poster
4 posts since Feb 2008
Reputation Points: 10
Solved Threads: 0
 

Your description to us is so vague that we can't really help.

How exactly does your professor expect you to display a bmp? Did he provide the bmps to display? Are you using the Windows API or some other GUI framework?

What sort of calculations are you doing? What does the input text file look like?

Duoas
Postaholic
2,043 posts since Oct 2007
Reputation Points: 1,140
Solved Threads: 229
 

Well,

First I will import an array of numbers from a .txt file. It looks like
33
35
39
44
41
38
...

Then I will simply detect the peak points in this array. Then depending on the value I need to display one of three previously existing .bmp images on a background bitmap file at a position determined by the index of the peak point.

This is not an homework. It is just a part of a project I am working on. I can write it either in C or C++.

kedi
Newbie Poster
4 posts since Feb 2008
Reputation Points: 10
Solved Threads: 0
 

I am an electrical engineer not software engineer. Unfortunately I am not very good at programming...

kedi
Newbie Poster
4 posts since Feb 2008
Reputation Points: 10
Solved Threads: 0
 

You migth want to download the OpenCV lib. It has some nice samples/tutorials and it is very easy to display an image with OpenCV. No need for windows libraries.

Niek

Nick Evan
Not a Llama
Moderator
10,112 posts since Oct 2006
Reputation Points: 4,142
Solved Threads: 403
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You