I have a custom widget subclassed from Fl_Window as part of my user interface, in which I'd like to display a 640-by-480-pixel grayscale image and draw a few lines on the image. When I display the image, the last few lines have seemingly random data replacing the pixel values.
I have retrieved the current image data array (using Fl_RGB_Image::data()) and printed the values to a comma-delimited text file. I loaded this file into Matlab and the image looks fine.
I've tried with several images of different objects, all .BMP files. With images containing fewer pixels, it seems to obscure a larger number of the pixels.
I am using FLTK 1.3.2 with MinGW (g++ version 4.8.1) on Windows 7 64-bit.
Has anyone seen this behavior before? Any ideas of what I might try to further diagnose the problem? Everything I can see says that the images are fine.
[imm] I see Greg’s already given a few hints, and I’d be interested to hear what happens if you open your .bmp file using fltk’s own test/pixmap_browser demo sample.
It handles the image formats that fltk “knows” about, including .bmp, so if it can *not* cope with your images then that gives us somewhere solid to start from.
If they open OK in in test/pixmap_browser then I guess that might be something in your derived widget? If it fails in test/pixmap_browser, then that gives us some code we all have, that can be tested on a variety of systems...
FWIW, the test/pixmap_browser demo works fine for me this morning!
Cheers
Selex ES 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.
********************************************************************
I have a custom widget subclassed from Fl_Window as part of my user interface, in which I'd like to display a 640-by-480-pixel grayscale image and draw a few lines on the image. When I display the image, the last few lines have seemingly random data replacing the pixel values.
I have retrieved the current image data array (using Fl_RGB_Image::data()) and printed the values to a comma-delimited text file. I loaded this file into Matlab and the image looks fine.
I've tried with several images of different objects, all .BMP files. With images containing fewer pixels, it seems to obscure a larger number of the pixels.
I am using FLTK 1.3.2 with MinGW (g++ version 4.8.1) on Windows 7 64-bit.
Has anyone seen this behavior before? Any ideas of what I might try to further diagnose the problem? Everything I can see says that the images are fine.
[imm] I see Greg’s already given a few hints, and I’d be interested to hear what happens if you open your .bmp file using fltk’s own test/pixmap_browser demo sample.
It handles the image formats that fltk “knows” about, including .bmp, so if it can *not* cope with your images then that gives us somewhere solid to start from.
If they open OK in in test/pixmap_browser then I guess that might be something in your derived widget? If it fails in test/pixmap_browser, then that gives us some code we all have, that can be tested on a variety of systems...
FWIW, the test/pixmap_browser demo works fine for me this morning!
All of my test images open perfectly fine with the test/pixmap_browser demo. (I hadn't seen that one--I appreciate the suggestion and will look more closely at the test folder when I run into trouble in the future!) I guess that tells me there's probably nothing wrong with my images, and instead something wrong with my code.
I've been trying to reduce my code to a simple "demo" version I can post online, and I've run into some trouble deciding what I can chop out. It may take me another day or two to get it together.
[imm]
In case it helps, there is an old how-to I wrote centuries ago that might be relevant:
http://www.fltk.org/articles.php?L468
Though I’m not sure how pertinent to your problem that will be.
All of my test images open perfectly fine with the test/pixmap_browser demo. (I hadn't seen that one--I appreciate the suggestion and will look more closely at the test folder when I run into trouble in the future!) I guess that tells me there's probably nothing wrong with my images, and instead something wrong with my code.
I've been trying to reduce my code to a simple "demo" version I can post online, and I've run into some trouble deciding what I can chop out. It may take me another day or two to get it together.
[imm]
In case it helps, there is an old how-to I wrote centuries ago that might be relevant:
http://www.fltk.org/articles.php?L468
Though I’m not sure how pertinent to your problem that will be.