On Mar 14, 2007, at 10:36 PM, Maximilian Matthé wrote:

> 1) Is it possible, to load an image with one function-call without
> knowing the type of the image (.jpg, png, etc).
> e.g.
> Fl_Image* img = Fl_loadimage("filename.jpg");
> Fl_Image* img2 = Fl_loadimage("filename.bmp");

Yes, use Fl_Shared_Image
http://www.fltk.org/documentation.php/doc-1.1/Fl_Shared_Image.html

> 2) Is it possible to draw parts of an image, e.g. only the rect from
> (10, 10) to (100, 100)?

Yes, the second version of "draw" draws sub-areas:
http://www.fltk.org/documentation.php/doc-1.1/ 
Fl_Image.html#Fl_Image.draw

> 3) Is it possible to draw an image into a specified rect, meaning to
> scale the image?
> e.g. draw an 1000*1000 sized image into a rect on the screen with the
> sizes 500*123?

Yes, you do that by duplicating the image with a new size. This is  
very simple (and fast) scaling. If you need any filtering, you can  
take a look at the Fl_RGB_Image class and see how the scaling is done  
there:
http://www.fltk.org/documentation.php/doc-1.1/ 
Fl_Image.html#Fl_Image.copy

> 4) Is it possible to draw parts of an image scaled to a specified  
> rect?
> (meaning combining 2) and 3) )?

Yes, copy the image first, then use the draw function as mentioned  
above.

> 5) Is it possible to modify images permanently in memory, for example
> resizing it?

Yes, see 3)

It can be useful to do some of the manipulations using OpenGL and  
hardware accelerated texture mapping. That really depends on your  
application and requirements.... .

----
http://robowerk.com/


_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to