I have written a C++ program to perform a slide show that works perfectly sequentially and randomly on my ubuntu desktop and also on the target Raspberry Pi where the slide show should run.
This is basically the code I use to display:
#include "CImg.h"
using namespace cimg_library;
int main(int argc, char **argv) {
const char const folder = cimg_option("-i",".","Path containing pictures");
char pattern[1024];
std::snprintf(pattern,1024,"%s/.jpg",folder);
const CImgList filenames = cimg::files(pattern,true,0,true);
CImgDisplay disp(1,1,0,0,1,1);
cimglist_for(filenames,l) {
const char
*const filename = filenames[l],
*const basename = cimg::basename(filename);
const CImg img(filename);
disp.resize(cimg_fitscreen(img.width(),img.height(),1),0);
disp.display(img).set_title(basename);
if (disp.is_keyESC()) std::exit(0);
cimg::wait(3000);
}
return 0;
}"
The program runs perfectly but the pictures are not displayed full screen as I would. I presume that the reason depends from the resize disposition. I have seen the command § set_fullscreen(), but I do not achieve the solution.
What I would is that the pictures were viewed (as Ubuntu Shotwell Photo Manager or Raspberry Image Viewer do) on full screen without deformations.
I hope you could give me an example of how I should code. Thanks, Renato Rocci