Displaying a picture in a dialog box

  • Thread starter Thread starter finchie_88
  • Start date Start date
  • Tags Tags
    Box Picture
Click For Summary

Discussion Overview

The discussion revolves around how to display a JPEG image in a dialog box using C++. Participants explore various contexts, programming environments, and libraries that may facilitate this task, particularly in the context of developing a Tetris game.

Discussion Character

  • Technical explanation
  • Exploratory
  • Homework-related

Main Points Raised

  • One participant seeks guidance on displaying a JPEG image in a dialog box.
  • Another participant asks for clarification on the context, specifically whether it is for a website or a programming language.
  • Suggestions are made to use HTML image tags for displaying images hosted online, though this may not apply directly to the C++ context.
  • A participant clarifies they are using C++ to develop a Tetris game and expresses a desire to add images.
  • It is noted that C++ lacks standard graphics functions, and participants suggest using libraries that are dependent on the operating system and compiler.
  • One participant mentions using the Win32 API and recommends searching for resources on Bitmaps and Device Contexts for Windows programming.
  • Alternatives such as LibSDL and Allegro are proposed as potentially simpler options for handling graphics in C++.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the best approach to display images in a dialog box, with multiple suggestions and tools being discussed. The discussion remains unresolved regarding the most effective method for the specific context of the user's project.

Contextual Notes

Limitations include the lack of specific details about the image display requirements and the potential complexity of using the Win32 API for beginners.

finchie_88
Hi everyone. I want to display a picture (a jpeg if that make any difference) inside a dialog box, how do I do it?
 
Technology news on Phys.org
What's the context--is this a website? What programming language?
 
Is it an online journal? It would depend on what has been disabled. You can try <img src="http://xxxxxxxxxxxxxxxxxxxxx"border=0> to upload a picture that is hosted on a website.
 
Last edited by a moderator:
Sorry about the lack of information. I'm writing in C++, and want to make a tetris game. It's going ok, I just wanted to add a few pictures that's all.
 
Evo said:
Is it an online journal? It would depend on what has been disabled. You can try <img src="http://xxxxxxxxxxxxxxxxxxxxx"border=0> to upload a picture that is hosted on a website.

<img src="http://xxxxxxxxxxxxxxxxxxxxx.extension" border="0" alt="alt_text_here" />

*cough*

:smile:
 
Last edited by a moderator:
Mattara said:
<img src="http://xxxxxxxxxxxxxxxxxxxxx.extension" border="0" alt="alt_text_here" />

*cough*
:smile:

Yeah, I turn red at the xxx stuff. I can't begin to imagine the material Evo is recommending.
 
Last edited by a moderator:
finchie_88 said:
I'm writing in C++, and want to make a tetris game. It's going ok, I just wanted to add a few pictures that's all.

The C++ language does not have standard functions for graphics. You have to use libraries that depend on which operating system you're using (MacOS? Unix/Linux? Or, er, uh, um, that thing Bill Gates sells? :wink: ), and possibly on which compiler or programming environment you're using.
 
ok, sorry, for the delay in replying. Anyway, the OS is windows, the IDE that I am using is Dev-C++ (and am using the default compiler provided with the download). I will be using the functions that are provided in the windows header file(s). I hope someone can help.
 
If you are just starting with windows programming, then using the Win32 API (i.e. the functions provided with the windows header files) might be a tad too difficult. You could do a quick google search on LibSDL or even Allegro as they will simplify your programming by a great deal.

If you do need to use the windows API, I suggest you go to the MSDN website and do a quick search on Bitmaps and Device Contexts. Also a good site to visit is: http://www.winprog.org/tutorial/ and follow the tutorials they have there.

Hope it helps.
 

Similar threads

  • · Replies 16 ·
Replies
16
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 34 ·
2
Replies
34
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 11 ·
Replies
11
Views
1K
  • · Replies 1 ·
Replies
1
Views
762
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K