> Is it possible to compile an jpeg-image into the binary? Or 
> do I really 
> have to have all the images hanging arround in the filesystem?

You can do it (I have done it) but there's no fltk mechanism to support it 
directly.

Also, before settling on jpeg, try your images in png format too - for small 
images (icons etc.) or images with large areas of flat colour, I find png is 
often more efficient than jpeg, and has the advantage of being lossless and not 
introducing compression artefacts.

What you need is some sort of "resource compiler" to borrow a MS term - 
basically to convert the png files into binary blobs you can link into your 
code.
We wrote our own but I'm sure there must be better ways to do it. Basically it 
stored the data as arrays in memory and returned a char* we could reference 
extern to point at the data.

Both libpng and libjpeg can be told to read from memory rather than from a file 
(but you need to do this by hand, I don't think the fltk image wrapper 
functions support this.)

Anyway, you read in the data then use that to fill in your image.

Now, as I'm typing this, I'm getting a bit of déjà vu - I'm pretty sure someone 
else was asking about this fairly recently, and perhaps even had a working 
solution.

Certainly worth trawling the archives, maybe even look at the STR's in case 
they posted any patches to support this...
-- 
Ian



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