On 18 Mar 2012, at 13:59, Sergey wrote:
> I can not get png-icons on the button in fltk2, simplified test/button.cxx:
> #include ...
> int main(int argc, char ** argv) {
> register_images();
> Window *window = new Window(320,65);
> window->begin();
> Button *but = new Button(120,20, 80, 25, "");
> but->image(new TiledImage(SharedImage::get("back.png")));
> window->end();
> window->show(argc,argv);
> return run();
> }
> It works fine, the icon fills up the entire button. When replacing TiledImage
> to Image, FileIcon ... I do not know how to use it (lots of combinations
> tried, does not reach). Decisions of the fltk_1 not work, because it have
> other API, for example, pngImage has no methods: load and load_image. Tell me
> one thread or tyknite on clear example file. Thank you in advance.
For a fltk-1.1 / fltk-1.3 example, see here:
http://seriss.com/people/erco/fltk/#Fl_JPG_Image
This is for JPEG rather than PNG, but the mechanisms are the same, just
s/JPEG/PNG/ and off you go.
Note that fltk2 is deprecated and largely unsupported, so switching to fltk-1.3
is more likely to get useful answers in the future...
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk