How to reduce exe size?
-
If you link statically to MFC, you're exe size is going to get bigger. You should have the option of using the shared version of MFC, if you want to really think about a small exe size. There are also other techniques of combining sections and using the proper compiler switches. Here are a few articles on reducing the size of the exe - http://msdn.microsoft.com/en-us/magazine/cc301696.aspx[^] http://www.catch22.net/tuts/minexe[^]
«_Superman_» I love work. It gives me something to do between weekends.
-
My static linked MFC exe file is over 7M now, I think it shouldn't be so large. I have tried two ways to reduce its size:
- Change resource bmp files from 24 bits to 16 bits What software can do the change? As I tested, both PaintBrush and PhotoShop (version 6) can not do. How about CorelDraw? I have CorelDraw but didn't install.
- Exclude some lib files. I did nothing for this, because I don't know how to detect which lib is unused and how to disable it.
Do you have any idea to reduce exe size with detail hints?
-
Member 4470227, I don't know software you mentioned. Is mspaint.exe PaintBrush or Paint program of Windows default tool? Or how to get them for free?
-
Member 4470227, I don't know software you mentioned. Is mspaint.exe PaintBrush or Paint program of Windows default tool? Or how to get them for free?
-
Member 4470227, I don't know software you mentioned. Is mspaint.exe PaintBrush or Paint program of Windows default tool? Or how to get them for free?
The paint program is pbrush.exe, and has been part of the OS install since Windows 3, if not before. It's got better as the years go on though! Iain.
I have now moved to Sweden for love (awwww). If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need cotract work done, give me a job! http://cv.imcsoft.co.uk/[^]
-
My static linked MFC exe file is over 7M now, I think it shouldn't be so large. I have tried two ways to reduce its size:
- Change resource bmp files from 24 bits to 16 bits What software can do the change? As I tested, both PaintBrush and PhotoShop (version 6) can not do. How about CorelDraw? I have CorelDraw but didn't install.
- Exclude some lib files. I did nothing for this, because I don't know how to detect which lib is unused and how to disable it.
Do you have any idea to reduce exe size with detail hints?
couldn't you use JPEG instead of BMP images? depending on size and complexity JPEG tends to compress images by a factor of 3 to 10 to 30. :)
Luc Pattyn
Local announcement (Antwerp region): Lange Wapper? Neen!
-
My static linked MFC exe file is over 7M now, I think it shouldn't be so large. I have tried two ways to reduce its size:
- Change resource bmp files from 24 bits to 16 bits What software can do the change? As I tested, both PaintBrush and PhotoShop (version 6) can not do. How about CorelDraw? I have CorelDraw but didn't install.
- Exclude some lib files. I did nothing for this, because I don't know how to detect which lib is unused and how to disable it.
Do you have any idea to reduce exe size with detail hints?
With Visual Studio 2005, under Linker Optimization, make sure you are eliminating unreferenced data, enable COMDAT folding and set Optimize for Windows98 to No. Check if you are overusing templates. They tend to chew up a lot of space. You could also turn off intrinsic functions. Under code generation, turn off "Buffer Security Check" (some will disagree, if you read up on it, you'll find it's nearly useless, but does use space.) Under Language, i always turn of Run-Time Type Info (savings is small, but I never use it so why not?) Reexamine everything you are linking to; sometimes you use a tiny function that pulls in a huge amount of code even though you don't really need it. If your resource bitmaps are big, consider PNG or JPG.
-
Member 4470227 wrote:
the mspaint.exe can convert 24bit true color image to 16bit ones.
Paint
sucks on decreasing color depth.Irfan View
, for instance, is really better. :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
My static linked MFC exe file is over 7M now, I think it shouldn't be so large. I have tried two ways to reduce its size:
- Change resource bmp files from 24 bits to 16 bits What software can do the change? As I tested, both PaintBrush and PhotoShop (version 6) can not do. How about CorelDraw? I have CorelDraw but didn't install.
- Exclude some lib files. I did nothing for this, because I don't know how to detect which lib is unused and how to disable it.
Do you have any idea to reduce exe size with detail hints?
includeh10 wrote:
Change resource bmp files from 24 bits to 16 bits What software can do the change? As I tested, both PaintBrush and PhotoShop (version 6) can not do. How about CorelDraw? I have CorelDraw but didn't install.
Decreasing the color depth may do the trick, provided you have many big images. Anyway this doesn't affect the executable's size when it is loaded in memory, I guess (unless you dynamically load, and then discard, images).
IrfanView
[^] a freeware image viewer, is very good in decreasing image color depth. :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
includeh10 wrote:
Change resource bmp files from 24 bits to 16 bits What software can do the change? As I tested, both PaintBrush and PhotoShop (version 6) can not do. How about CorelDraw? I have CorelDraw but didn't install.
Decreasing the color depth may do the trick, provided you have many big images. Anyway this doesn't affect the executable's size when it is loaded in memory, I guess (unless you dynamically load, and then discard, images).
IrfanView
[^] a freeware image viewer, is very good in decreasing image color depth. :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles]Decreasing the color depth may do the trick, provided you have many big images. Anyway this doesn't affect the executable's size when it is loaded in memory, //----------------------------------- It does affect exe size, when I change bmp from 24 bits to 256 color, exe size becomes smaller.