Hello everyone, I’m using: SWI-Prolog version 8.2.4.
I’m trying to show images in a frame in Prolog, I have read the userguide of XPCE and replicated the code of FileViewer demo. I made some modifications to the code to show an image in a certain window, the code seems to work pretty well when the format of the image is a JPG/JPEG but I want to be able to read also BMP images, is this possible in Unix/X11?
I have also read that a possible way to solve this is to convert this BMP files to JPG files, but this is not practical for our goals.
My predicate of viewing a file is called view as the same example provided (FileViewer Demo) and looks like this:
% your code here
view(DirObj, F) :-
send(new(V, view(F)), open),
get(DirObj, file(F), FileObj),
new(I,image(FileObj)),
new(Bitmap,bitmap(I)),
send(V,display,Bitmap).
Thanks