>
> > I am currently encountering a problem in my user interface,=20
> > that occurs only under Windows XP platforms.
> > I am creating a window that contains a PNG (or JPEG) image.
> >=20
> > It seems that loading a picture larger than 100 kbytes makes=20
> > my program crash (I modified that picture to another one of=20
> > 94 kb, and my application worked fine).
> > If I am not wrong, there is nowhere a specific note regarding=20
> > that limit. I also checked on this forum and on the Internet=20
> > but I did not find anything.
> > I am pretty sure this comes from the way I am using it.
>
> I don't think this is a fltk problem - AFAIK there is nothing in the
> fltk code that is sensitive to image size (well, at least until you run
> out of RAM, anyway...)
>
> So I'd have to guess that something else is awry in your code.
> You seem to be using a number of other libraries and frameworks in your
> code. Perhaps one of those has a limit?
>
> > Did anybody encounter such a problem ? Would you have any=20
> > idea where it could come from ?
>
> Well, attached below is a simple example of loading an image in fltk.
> I have tested this on WinXP with various jpg and png images up to about
> 1MB without any problems.
>
> ------------------------
>
> //
> // fltk-config --use-images --compile scroll-test.cxx
> //
> #include <FL/Fl.H>
> #include <FL/Fl_Double_Window.H>
> #include <FL/Fl_Scroll.H>
> #include <FL/Fl_Box.H>
> #include <FL/Fl_Shared_Image.H>
>
> #include <stdio.h>
>
> int main(int argc, char **argv) {
>
>   if(argc < 2) {
>     puts("Filename?");
>     return -1;
>   }
>
>   fl_register_images();
>   // load an image
>   Fl_Shared_Image *picture;
>   picture->get(argv[1]);
>
>   // Create the windows and widgets
>   Fl_Double_Window win(150, 150);
>   win.begin();
>   Fl_Scroll scroll(10, 10, win.w() - 20, win.h() - 20);
>   scroll.begin();
>
>   // get the loaded image
>   Fl_Image *image =3D (Fl_Image*)picture->images()[0];
>   // assign image to the display box
>   Fl_Box *img_box =3D new Fl_Box(0, 0, image->w(), image->h());
>   img_box->image(image);
>
>   scroll.end();
>   win.end();
>   win.resizable(scroll);
>   win.show();
>   return Fl::run();
> }
> /* End of File */
>
>
>
> SELEX Galileo Ltd
> Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS=
> 14 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.
> ********************************************************************
>


Thanks for your quick reply. This helped me to solve my problem, even if it did 
not solve it .
Maybe I am wrong, but it seems that the size of the box where the picture will 
be loaded determines the size of the allocated memory.
By increasing the size of the box, we managed to solve this bug.

Thanks again for your reply,

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

Reply via email to