> OK, compiled this code (bin2h.c) and it converts jpg/png to char 
> array....fine! I also can include it to my code... But, I 
> have NO idea 
> how to proceed now. I just don't know enough about the 
> subject matter...
> 
> So, do I really have to modify libpng/libjpg like mentioned later in 
> this thread? Or is it possible to modify Fl_PNG_Image, for 
> example, to 
> forward the pointer of the array where the image is stored to fltk?
> --> Any examples/docs to this?


Libpng is bundled with fltk anyway, and is almost certainly on your
development box too.

You do not have to modify libpng in any way, you just need to use it a
bit differently; the standard way we use it is to pass it a filename, it
opens the file and decompresses the contents into RAM, which you can
then use (and this is what the FL_PNG_Image stuff does for you.)

What you need to do instead is pass libpng a pointer to the compressed
data in memory (rather than the filename) and have it decompress that
into RAM for you to use.

I have a worked example of that somewhere, but I've spent a while
looking for it and can not find it anywhere... Sorry.
A quick Google about should throw up some worked examples though, I'm
sure.

Anyway, once you have your image decompressed into RAM, you can easily
load it into a fltk image - there are a couple of ways to do this, see
this how-to for a few starters:

http://www.fltk.org/articles.php?L468


Thereafter, well, hope for the best!


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

Reply via email to