It doesn't matter where they're loaded from (file, DLL, stream or
whatever). They're loaded into a manage Bitmap of Image class instance,
and that takes memory resources.
If it's possible to reduce color depth, it's probably worth doing so.
Also, how it's stored (color depth) can be affected by how it's loaded.
Minimizing the memory footprint of the bitmaps would be something to look
at.
We've not given an answer, becasue it's not something that's simple to
find out. There is no "GetAvailableDllLoadingSpace" API. FIrst you need
to fully understand how native DLLs are loaded. They are top-down, on 64k
boundaries, requiring contiguous space and they can't be loaded into the
same address that a DLL is loaded in another process.
Application heap allocations come up from the bottom. They're reserved in
64k blocks but committed in 4k pages. Of course the GC heap work even
separately from that. You can have a lot of free GC Heap space, but that
space is still allocated fromt he system and not available for loading
DLLs.
So sure, you can call GLobalMemoryStatus and get a rough idea of the
virtual space you have left in the process, but it won't tell you how much
of that space is not contiguous, in an address that another process
already loaded a DLL, not 64k aligned, etc. etc.
Getting that number is possible, but it's a *lot* of work and will be
pretty slow. Not somethig that you can realistically do at run time.
And of course the results will always be changing, especially across
different target platforms, with different stuff loaded by the OS at boot.
--
Chris Tacke, eMVP
Join the Embedded Developer Community
http://community.opennetcf.com