Hello & Thanks ,
win7 x64 , lapTop
I am trying out pb:
Everything so far is fast and well documented.
When I create MDI_ImageViewer.exe from Examples Folder ,
I notice it is 726kb .
To me that is enormous .
I have been using a different (windows) Basic
which creates tiny executables .
But it only runs on Windows .
Is there a way to cut down the size of executables ?
Also , will OSX and Linux produce about the same size executables ?
Thanks...Vernon
MDI_ImageViewer.exe @ 726kb
MDI_ImageViewer.exe @ 726kb
vmars.us Win11 x64 , Martin Guitar 000-16 (1995)
"All things in moderation , except for love and forgiveness."
"All things in moderation , except for love and forgiveness."
Re: MDI_ImageViewer.exe @ 726kb
I just tried under windows, x86, PB5.11, and the result it's 578 KB (591.872 bytes)
That said, those lines
are responsible for the size of the exe, since they means all those image decoding plugins are included in the final exe.
Removing them the exe size can be dramatically reduced, but then you have to use something else to open the image files.
For example, under windows, you can use gdi plus. Since it's an external DLL your exe will be much smaller.
That said, those lines
Code: Select all
UseJPEGImageDecoder()
UsePNGImageDecoder()
UseTGAImageDecoder()
UseTIFFImageDecoder()
Removing them the exe size can be dramatically reduced, but then you have to use something else to open the image files.
For example, under windows, you can use gdi plus. Since it's an external DLL your exe will be much smaller.
"Have you tried turning it off and on again ?"
Re: MDI_ImageViewer.exe @ 726kb
It is 579k here. Remove the Image format decoders and it is 38,5k:
But now it can only load BMP on Windows. No JPG, PNG, TGA, TIFF anymore. You can write Image Loaders
with WinAPI that are much smaller (because the decoder is in a WinAPI DLL). It is not cross-platform then,
so using PB's built-in Image decoders is best for cross-platform development. The size is the price you pay.
Code: Select all
;UseJPEGImageDecoder()
;UsePNGImageDecoder()
;UseTGAImageDecoder()
;UseTIFFImageDecoder()with WinAPI that are much smaller (because the decoder is in a WinAPI DLL). It is not cross-platform then,
so using PB's built-in Image decoders is best for cross-platform development. The size is the price you pay.
Re: MDI_ImageViewer.exe @ 726kb
Oh, I see...Thanks
So , I could take this same source as is ,
and run it on mac and linux ?
Thanks..vm
So , I could take this same source as is ,
and run it on mac and linux ?
Thanks..vm
vmars.us Win11 x64 , Martin Guitar 000-16 (1995)
"All things in moderation , except for love and forgiveness."
"All things in moderation , except for love and forgiveness."
Re: MDI_ImageViewer.exe @ 726kb
For this specific one the answer is NO, since it's using the MDIGadget() that is supported only on Windows.
See -> http://www.purebasic.com/documentation/ ... cific.html
But in general, more or less, with some massaging, with some conditional compilation, with a good knowledge of all the target OSes, sometimes the answer is yes.
See -> http://www.purebasic.com/documentation/ ... cific.html
But in general, more or less, with some massaging, with some conditional compilation, with a good knowledge of all the target OSes, sometimes the answer is yes.
"Have you tried turning it off and on again ?"

