FBImage static Win/Lin 32/64-bit
-
- Posts: 8586
- Joined: May 28, 2005 3:28
- Contact:
Re: Library FBImage for Windows/Linux 32/64-bit.
Why you put it in the FreeBASIC folder ?
Put the include file and *.dll or *.so in ther folder of your application thats all.
Joshy
Put the include file and *.dll or *.so in ther folder of your application thats all.
Joshy
Re: Library FBImage for Windows/Linux 32/64-bit.
so, if I have a folder - lets call it a project folder, that I keep all my associated images in along with my .BAS file, it is in this folder I should put these additional files into?D.J.Peters wrote:Why you put it in the FreeBASIC folder ?
Put the include file and *.dll or *.so in ther folder of your application thats all.
Joshy
FBImage.bi
FBImage-64.dll
libFBImage-64.so
(I am using windows 10 / 64 bit...so I choose the 64 bit versions, right?)
which means that if I have ANOTHER project, in a different folder, I have to copy these 3 files into that folder as well, and to EVERY folder that I want to use this library? I will end up with FBimage files all over my puter! or am I missing something here?
Re: Library FBImage for Windows/Linux 32/64-bit.
@leopardpm,
there is a big difference, between DLL's and static LIB:
DLL's always have to be accessible to the Program, that uses them.
That means usually, in the Folder the executable is located.
Alternative: set a Path, to the DLL's, #LibPath Statement ... before DyLibLoad.
Static Lib:
Is compiled *into* the executable. So, after compilation no *external* files are
needed at all. (My reason, to prefer Static, over Dynamic, aka: DLL Hell.)
Static Lib's are usually in FBC SubFolder /lib/[OS]. The needed BI's are in /inc.
there is a big difference, between DLL's and static LIB:
DLL's always have to be accessible to the Program, that uses them.
That means usually, in the Folder the executable is located.
Alternative: set a Path, to the DLL's, #LibPath Statement ... before DyLibLoad.
Static Lib:
Is compiled *into* the executable. So, after compilation no *external* files are
needed at all. (My reason, to prefer Static, over Dynamic, aka: DLL Hell.)
Static Lib's are usually in FBC SubFolder /lib/[OS]. The needed BI's are in /inc.
Re: Library FBImage for Windows/Linux 32/64-bit.
thank you, Mr. Swiss - and I am with you... go the static lib way if possible
so, I only need two files and need to put them into the following places:
put into the FB /lib/[OS] folder:
libFBImage-64.so
put into the FB /inc folder:
FBImage.bi
disregard the file:
FBImage-64.dll
and any program I create anywhere on my HD needs to have these statements:
#include once "FBImage.bi"
right?
so, I only need two files and need to put them into the following places:
put into the FB /lib/[OS] folder:
libFBImage-64.so
put into the FB /inc folder:
FBImage.bi
disregard the file:
FBImage-64.dll
and any program I create anywhere on my HD needs to have these statements:
#include once "FBImage.bi"
right?
Re: Library FBImage for Windows/Linux 32/64-bit.
Are you on Linux or Windows? The .so file can be installed to /usr/local/lib on linux. The dll on windows should just be bundled with your compiled EXE. If you want to ship the .so file with your compiled binary on linux, you can do that but you will likely need a wrapper script to set LD_LIBRARY_PATH (firefox does this, for example).
Static libraries make distribution easy, but dynamic libraries are easier to update without a recompile sometimes.
Static libraries make distribution easy, but dynamic libraries are easier to update without a recompile sometimes.
Re: Library FBImage for Windows/Linux 32/64-bit.
I am in windows, and I what to do static libs, not DLLs... sometimes I send my EXEs to friends and its easier than having to include DLLs each time...
Re: Library FBImage for Windows/Linux 32/64-bit.
Okay you'll need to ignore the .so file then. That's for Linux.
-
- Posts: 8586
- Joined: May 28, 2005 3:28
- Contact:
Re: Library FBImage for Windows/Linux 32/64-bit.
removed: all dynamic libs
added: SavePNGFile()
Joshy
file: test_save_rgb_png.basfile: test_save_rgba_png.bas
added: SavePNGFile()
Joshy
file: test_save_rgb_png.bas
Code: Select all
#include once "FBImage.bi"
chdir exepath()
screenres 640,480,24
var img = LoadRGBAFile("tire.jpg")
put (0,0),img,pset
var ok = SavePNGFile(img,"test_rgb.png") ' ignore Alpha channel (if any)
windowtitle "SavePNGile() = " & ok
sleep
Code: Select all
#include once "FBImage.bi"
chdir exepath()
screenres 640,480,32
var img = LoadRGBAFile("lights_alpha.png")
put (0,0),img,ALPHA
var ok = SavePNGFile(img,"test_rgba.png",true) ' true = RGB + Alpha channel
windowtitle "SavePNGFile() = " & ok
sleep
-
- Posts: 8586
- Joined: May 28, 2005 3:28
- Contact:
Re: Library FBImage for Windows/Linux 32/64-bit.
I have no time to test it on all platforms would be cool if i can get a report of your experiments with the new FBImage lib.
Thank you
Joshy
Thank you
Joshy
-
- Posts: 8586
- Joined: May 28, 2005 3:28
- Contact:
Re: Library FBImage for Windows/Linux 32/64-bit.
No one can give me a report ?
Shame on you. :-)
Joshy
Shame on you. :-)
Joshy
Re: Library FBImage for Windows/Linux 32/64-bit.
haven't had time to download and try.... will do it this evening, Mr Peters!
Re: Library FBImage for Windows/Linux 32/64-bit.
Mr. Peters,
I downloaded your FBImage library and it worked perfectly. I am using Windows 7 64bit and Freebasic 32bit.
I also use your FLTK libraries. Your hard work is appreciated.
Thanks,
Darren
I downloaded your FBImage library and it worked perfectly. I am using Windows 7 64bit and Freebasic 32bit.
I also use your FLTK libraries. Your hard work is appreciated.
Thanks,
Darren
Re: Library FBImage for Windows/Linux 32/64-bit.
Here is a little function to save the graphic screen (I hope it is correct...)
Code: Select all
#include once "FBImage.bi"
function savescreen(filename as string) as boolean
dim as integer w, h
dim as boolean ok
screeninfo w, h
var img = imagecreate(w, h)
get (0,0)-(w-1, h-1), img
ok = SavePNGFile(img, filename, true)
imagedestroy img
return ok
end function
dim as integer w, h
chdir exepath()
screenres 640,480,32
' Transparent background
line (0, 0)-(639, 479), &h00FF0000, bf
' Opaque disk
circle (320, 240), 150, &hFF0000FF, , , , f
windowtitle "SaveScreen = " & cbool(savescreen("save_screen_rgba.png"))
sleep
Re: Library FBImage for Windows/Linux 32/64-bit.
D.J.Peters wrote:I have no time to test it on all platforms would be cool if i can get a report of your experiments with the new FBImage lib.
Thank you
Joshy
I have tested on Windows 7 64bit. with both the 32 and 64 bit compilers. It works fine here. I can try on Windows 10 before too long and will get back to you.