Load image from memory.



I'm trying to include a image in my Free Pascal program under linux.
First I loaded the image from a file using gtk_image_new_from_file, but I want to have the picture inside the 
binary.

What I have done so far:
* Made a include-file for fpc using bin2obj.
* Included the file in source using {$i logo.inc}  //logo.inc is a include file from the picture logo.jpg
* Decleared p: pointer; and set p := @logo;

I have not worked with pointers before and I do not know how I can get this picture from the memory to a 
GtkImage. (Or show it in any way).

I heard around and was told the solution might be to use gdk_pixmap_create_from_xpm_d which returns a 
GdkBitmap. Then gtk_image_new_from_pixmap allows to create a GtkImage from a GdbBitmap.
But then the image must be stored in memory as XPM format.





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]