> I have a window which size is w=600, h=800, and has a jpeg > file which size is w=1024, h=768, I want to display the whole > image in the window. > > I have try to set the RESIZE_FIT and RESIZE_FILL flag, but is > still display partial of the image, how can I to scale the > image and display it in the window.
I don't think fltk provides for automatic scaling of images, so you need to do that "by hand" yourself. The "correct" way to do this is to access the raw image data then apply whatever interpolation and filtering you think is appropriate to resize the image with minimal visual degradation. However, you can use the image copy() methods in fltk to do basic resampling - works OK, but may cause some image degradation. To see how, refer to the pixmap_browser demo in the test folder. However, I see that has never been updated for fltk-2, so you may need to compare with the fltk-1.1 or fltk-1.3 versions to understand what is going on. It is simple enough. > my fltk version is 2.0 Which, as you know, is not widely supported - you would get better support using 1.1 or 1.3, to be honest. Indeed, those variants have working examples of doing exactly what you are asking... 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

