> I'm fairly new to FLTK, and I want to create a neat looking interface > using FLTL on an embedded system without OpenGL. > What would like to have is a "progress bar" in the shape of an battery. > For this I made a battery picture, but I'm a little stuck on how I can > only select a part of that image and put that on the screen. FLTK doesn't > seem to have a funcion like CopyRect(Source, Dest, SrcRect, DestRect) to > simply copy a part of an image to another image. (Might come handy in the > future). > So I was wondering do I need to make such functions myself or does FLTK > provide something functionallity for handeling parts of an image or > drawing parts of images on a canvas-like component?
There are a few ways to do this, but what I'd do is render the entire battery image into an fl_offscreen buffer and then use fl_copy_offscreen(...) to blit progressively more of the battery image onto the foreground widget as the progress increases. That's fairly cheap to do and reasonably efficient, so should probably work fine for your case... I hope! 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

