Hi,

I would like to know the correct usage of fl_draw_image(). Lets say I want to 
draw my custom buffer inside my window, at positions 0,0 with dimensions 20x20 
pixels.

I doesn't show up if I do it this way:

    // make a dummy image buffer
    uchar buf[20 * 20 * 3];
    for (int i = 0; i < 20; ++i)
    {
        for (int j = 0; j < 20; ++j)
        {
            buf[3*(i * 20 + j)] = 100;
            buf[3*(i * 20 + j) + 1] = 25;
            buf[3*(i * 20 + j) + 2] = 200;
        }
    }

    Fl_Window *win = new Fl_Window(500, 200);
    fl_draw_image(buf, 0, 0, 20, 20); // do I call it here?
    win->end();
    Fl::visual(FL_RGB);
    win->show();

    return(Fl::run());

And if I call it After win->show(), I see it, but at 0,0 coords of my screen, 
not the window. This is not what I want. It also doesn't seem to get updated.
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to