Graphic File: Embedded Resource vs Content File; Pro's Cons on the mobile platform? RRS feed

  • Question

  • What are the pro's and con's of using Embedded Resource vs Content File, for graphic images (PNGs)
    That need to be loaded via code ?

    I am concerned that Embedded will load all the graphic files when the executable starts, vs the content file that only gets loaded when it is referenced.
    Thursday, June 11, 2009 6:18 PM


  • It depends on the time, resource number, usage and occurance.

    - if You use gfx files frequently and want it to be loaded fast - load from files to a memory during startup and use them many times by handles.
    - if You want to preserve some space on device and want it to look professional (not like \Windows garbage) use dll resources along with IImaging API which loads them very fast (40 gifs in less then 1sec) into memory (do it at startup along with loading dialog)
    - if You use ony 3-4 graphics and not so frequently use files or internal apps resources but if more and use external dll resources

    Personally I had enough seeing my exe growing with internal resources (looks amateur) and made some tests with IImaging and external dll resources. Results were astonishing and now I have one dll with everything I use in my app.
    Another merit of such solution is that You can easy implement skin feature into Your app if You wish (just change dll with other with same resIds).

    If You'll find my answer satisfactory or helpful - mark it as answered! Thank You.
    • Proposed as answer by Mal Loth Thursday, June 11, 2009 7:01 PM
    • Marked as answer by warrentang Thursday, June 18, 2009 1:42 AM
    Thursday, June 11, 2009 7:00 PM