// Display Image test
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Button.H>
#include <FL/Fl_Box.H>
#include <FL/Fl_JPEG_Image.H>
// Global pointers for the GUI objects
Fl_Window *mywindow;
Fl_Box *mypicturebox;
Fl_JPEG_Image *logo;
// Callback function
void mybutton_cb(Fl_Widget * w, long int data)
{
if (data == 1) {
mypicturebox->image(logo);
mypicturebox->redraw();
}
}
int main()
{
// The main window
mywindow = new Fl_Window(480, 320, "Display Logo");
// Load the image
logo = new Fl_JPEG_Image("logo.jpg");
// Provide a box for the image
mypicturebox = new Fl_Box(16, 20, 320, 160);
mypicturebox->image(logo);
// Make the window visible
mywindow->end();
mywindow->show();
return Fl::run();
}