> Cheers for the answers all, I am firing up gimp as we speak,, but
> how about if i wanted to load the image at runtime? How would
> that work
> I understand the image has to be packaged and available with the app
> if this is the case.
If you are running fltk-1.3, then this is pretty easy: See below.
The only trick to this is ensuring that the image is where you think it
is...
I have code to "help" with that too, though, if you need it.
---------
#include <FL/Fl.H>
#include <FL/Fl_PNG_Image.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Button.H>
static Fl_Window *win = 0;
static Fl_Button *but = 0;
static Fl_PNG_Image *picture = 0;
void ButtonCallback(Fl_Widget *, void *) {
static int ncol = 53;
but->labelcolor((Fl_Color)ncol);
but->redraw();
/* get a different colour */
ncol += 5;
if(ncol > 80) ncol = 53;
}
int main(int argc, char **argv) {
picture = new Fl_PNG_Image("some-image-512x512.png");
win = new Fl_Double_Window(700, 600);
win->begin();
but = new Fl_Button(10, 10, 512, 512, "Push Me");
but->image(picture);
but->align(FL_ALIGN_IMAGE_BACKDROP);
but->labelcolor(FL_WHITE);
but->labelsize(28);
but->callback(ButtonCallback);
win->end();
win->show(argc, argv);
return Fl::run();
}
/* end of file */
SELEX Galileo Ltd
Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14
3EL
A company registered in England & Wales. Company no. 02426132
********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk