> I am currently encountering a problem in my user interface,
> that occurs only under Windows XP platforms.
> I am creating a window that contains a PNG (or JPEG) image.
>
> It seems that loading a picture larger than 100 kbytes makes
> my program crash (I modified that picture to another one of
> 94 kb, and my application worked fine).
> If I am not wrong, there is nowhere a specific note regarding
> that limit. I also checked on this forum and on the Internet
> 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
> 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 = (Fl_Image*)picture->images()[0];
// assign image to the display box
Fl_Box *img_box = 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 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