From: "Michael W. Ryder" <_mwryder@...> Date: 2009-02-21T09:44:50+09:00 Subject: Re: showing a picture Tim Hunter wrote: > Justin Collins wrote: >> Sigge Sg wrote: >>> Can anyone tell me the code for showing a picture in the "my pictures" >>> folder? Please!! >>> I've just started programing, so I don't so much about it. >>> >> RMagick is probably a good place to start for displaying messages. >> (http://studio.imagemagick.org/RMagick/doc/usage.html#displaying) >> I bet you could poke around and find some examples. >> >> -Justin >> >> > > Thanks for the recommendation, Justin, but while RMagick can do many > things, it can't display an image on MS Windows because its display > method depends on a X server, which doesn't exist for MS Windows. So it > goes. > > I'm not a Win guru, but wouldn't the simplest thing to do be to start an > external image display program like IrfanView and tell it to display > the image? > > my_image = "test.bmp" > system("start /wait i_view32 " + my_image) > If you are running XP and have the file associations set you can just use: system("start /wait " + my_image) This way you can display multiple types of files without having to check for extensions. I used this method in a C program I wrote years ago to display mixed file types.