Displaying a picture in a dialog box

In summary, the conversation was about how to display a picture (jpeg) in a dialog box using C++ for a tetris game. The recommended method was to use the <img> tag with a hosted image. However, for more complex graphics, libraries such as LibSDL or Allegro may be more helpful. For those new to windows programming, using the Win32 API may be difficult, but resources such as MSDN and tutorials online can provide guidance.
  • #1
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
  • #2
What's the context--is this a website? What programming language?
 
  • #3
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:
  • #4
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.
 
  • #5
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*

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

*cough*
:rofl:

Yeah, I turn red at the xxx stuff. I can't begin to imagine the material Evo is recommending.
 
Last edited by a moderator:
  • #7
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.
 
  • #8
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.
 
  • #9
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.
 

What is the purpose of displaying a picture in a dialog box?

The purpose of displaying a picture in a dialog box is to provide visual information or guidance to the user in a more prominent and eye-catching way.

How do I display a picture in a dialog box?

To display a picture in a dialog box, you can use a programming language such as HTML, JavaScript or CSS to create a dialog box and insert the picture using the appropriate code or element.

Can I customize the appearance of the picture in the dialog box?

Yes, you can customize the appearance of the picture in the dialog box by using CSS to adjust the size, position, border, and other visual elements of the image.

Can I display multiple pictures in a single dialog box?

Yes, you can display multiple pictures in a single dialog box by using HTML or JavaScript to create a slideshow or gallery within the dialog box.

Is it possible to make the picture in the dialog box clickable?

Yes, you can make the picture in the dialog box clickable by using a link or button element and adding an event listener in JavaScript to handle the click and perform the desired action.

Similar threads

  • Programming and Computer Science
Replies
16
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • Programming and Computer Science
Replies
34
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • Programming and Computer Science
Replies
1
Views
1K
  • Programming and Computer Science
Replies
9
Views
1K
  • Programming and Computer Science
Replies
5
Views
2K
  • Computing and Technology
Replies
27
Views
2K
  • Programming and Computer Science
Replies
1
Views
1K
  • Electrical Engineering
Replies
3
Views
243
Back
Top