Displaying a picture in a dialog box

  • Thread starter Thread starter finchie_88
  • Start date Start date
  • Tags Tags
    Box Picture
AI Thread Summary
To display a JPEG image in a dialog box while developing a Tetris game in C++, the discussion emphasizes that C++ lacks standard graphics functions, necessitating the use of external libraries. The context is Windows, using Dev-C++ as the IDE. Recommendations include utilizing the Win32 API, which may be complex for beginners, or opting for simpler libraries like LibSDL or Allegro to facilitate graphics handling. For those choosing the Win32 API, resources such as the MSDN website for Bitmaps and Device Contexts, along with tutorials from winprog.org, are suggested for guidance.
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
1
Views
1K
Replies
2
Views
2K
Replies
34
Views
4K
Replies
2
Views
2K
Replies
10
Views
131
Replies
4
Views
1K
Replies
1
Views
2K
Back
Top