Hello FLTK User's

I want to display two images  in a single window(in two seperate boxex) such
that their height and width is adjusted according to the height and width of
the box in which the image is being displayed, i.e the whole image should be
displayed in the limited box area. I guess the term is known as viewport
setting, I have written the following code fragment please suggest whats
wrong in the code as the image does not confront to the box size it comes
out of the box.

#include <stdio.h>
#include <stdlib.h>
#include <FL/Fl.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Shared_Image.H>
#include <FL/Fl_JPEG_Image.H>
#include <FL/Fl_Box.H>

#define TOTAL 2

Fl_Window *win = 0;
Fl_JPEG_Image *jpgs[TOTAL];
Fl_Group *grp[2];

int main()
{
    fl_register_images();
    Fl_Window win(800, 600, "Display Pics");
    Fl_Box box1(0, 0, 400,300);
    Fl_JPEG_Image jpg1("0007.jpg");
    box1.image(jpg1);
    Fl_Box        box2(400, 0, 400,300);
    Fl_JPEG_Image jpg2("0008.jpg");
    box2.image(jpg2);
    win.show();
    return(Fl::run());
}

If possible please send me a code fragement


-- 
Himadri Sarkar
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to