could someone give me an example of how to display a picture on the screen in Linux (jpg, bmp, whatever)
I found the example in the "examples" portion of the documentation but it doesn't seem to work for me
the first statement in the example:
#include "/usr/local/include/freebasic/FreeImage.bi"
throws an error:
ld: cannot find -lfreeimage
and I've checked "FreeImage.bi" is there...so
what is the simplest way...thankx
display JPG or BMP problem
Re: display JPG or BMP problem
Try to install: libfreeimage-dev
-
- Posts: 8586
- Joined: May 28, 2005 3:28
- Contact:
Re: display JPG or BMP problem
We have fbimage it doesn't need any extra runtime libray it's a static lib !
Programming->Libraries->fbimage
Joshy
Programming->Libraries->fbimage
Joshy
Re: display JPG or BMP problem
If only 'bmp' is enough:
BTW: Why is this in section linux?
Code: Select all
#include "fbgfx.bi"
function load_bmp(file_name as string) as fb.image ptr
dim as long file_num = freefile()
dim as ulong image_width, image_height
dim as fb.image ptr pImage
if open(file_name, for binary, access read, as file_num) = 0 then
get #file_num, 18+1, image_width
get #file_num, 22+1, image_height
close #file_num
pImage = imagecreate(image_width, image_height) 'allocate image memory
bload(file_name, pImage) 'bitmap into memory
return pImage
else
return 0
end if
end function
screenres 800,600,32
dim as string bmp_file_name = "test.bmp"
dim as fb.image ptr pImage = load_bmp(bmp_file_name)
if pImage <> 0 then
put(20, 20), pImage, pset
imagedestroy(pImage)
else
print "Error. No such file?: " & bmp_file_name
end if
getkey()