Hi Anitban,
Here's what works for me in fltk-2:
makefile stuff: (the kitchen sink)
g++ -Wall -g -o x main.o common.o ctx.o ents.o glw.o gui.o lay.o
prompts.o -L/usr/X11R6/lib64 -lfltk2 -lfltk2_gl -lfltk2_glut -lm -lX11 -lXi
-lXft -lXmu -lpthread -lXinerama -lm -lXext -lGL -lGLU -lfltk2_images -lpng
-ljpeg -lz -lsupc++
int the prmt header file:
#include <fltk/SharedImage.h>
...
class Prmt : public Window
{
....
Widget icon; // the widget that will hold the image
fltk::SharedImage *pngi; // the image pointer
the constructor for the prmt class:
Prmt::Prmt( int wx, int wy)
: Window( wx, wy, WINW, WINH, 0, true),
msg1 ( 4*BORDER+ICON, 2*BORDER, TEXTW, 2*TEXTH),
msg2 ( 2*BORDER, WINH-BORDER, TEXTW+ICON, TEXTH),
msgd ( -BORDER, -BORDER, 0, 0),
icon ( 2*BORDER, 2*BORDER, ICON, ICON)
// this places the 'icon' widget into the window
{
...
icon.image((Image*)pngi); // this places the image pointer into the widget
...
|
Placing the image into the 'icon' widget:
bool Prmt::get_text( const char *m1, const char *m2, std::string &e1)
// Descr: access point to get text from Prmt
{
.....
pngi = pngImage::get( "images/gnome-question.png");
....
}
I hope this helps,
Marty
Anirban <[EMAIL PROTECTED]> wrote: > Anirban wrote:
> > I am unable to get a JPEG image displayed a window.
> > Is it supposed to be done as it is done in the "About FLUID".
>
> For a simple example, see:
> http://seriss.com/people/erco/fltk/#Fl_JPG_Image
I tried to compile it with -lfltk_jpeg and -lfltk_images
nothing worked.
But on removing "fl_register_images();" it did!!!
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk
---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk