Results 1 to 3 of 3

Thread: VB6 ImageCaching and -Animation (using a single Resource-File for storage)

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jun 2013
    Posts
    7,253

    VB6 ImageCaching and -Animation (using a single Resource-File for storage)

    Just a Demo which applies the cGDIPlusCache-Class (as intended, as a Drop-In-Module).

    The original CodeBank-entry for cGDIPlusCache is here: https://www.vbforums.com/showthread....-cls-revisited

    cGDIPlusCache (as included in this Demo) was enhanced about two new Methods:
    • SaveCacheToImgStore(StoreFileName As String)
    • ReadCacheFromImgStore(StoreFileName As String)


    When run in IDE-Mode, the Demo will populate the GC-CacheObject directly from a \Res\-Subfolder -
    (via GC-Add... Methods which in this case load PNGs, JPGs or GIFs directly from the FileSystem)

    When the MainForm unloads (in IDE-Mode), then one of the new Methods is used:
    • GC.SaveCacheToImgStore App.Path & "\ImageCache.gc"


    So that, when the Demo runs compiled, it will ignore the Files in the \Res\-Subfolder (so no need to deploy it) -
    and instead loads the GC-Objects Cache-Content from a single File via:
    • GC.ReadCacheFromImgStore App.Path & "\ImageCache.gc"


    The whole User-Code (aside from the dropped-in cGDIPlusCache.cls-File) -
    sits in a single Form (with only about 25 Lines).

    That's enough to ensure a Checker-BackGround and two Animations (one from a GIF, another one from a "PNG-stripe").
    Name:  ImageCaching.png
Views: 553
Size:  15.5 KB

    Ok, here is the Zip: ImageCaching.zip

    Have fun,

    Olaf

  2. #2
    Lively Member
    Join Date
    Sep 2016
    Location
    Germany, Bavaria
    Posts
    75

    Re: VB6 ImageCaching and -Animation (using a single Resource-File for storage)

    Quote Originally Posted by Schmidt View Post
    Just a Demo which applies the cGDIPlusCache-Class (as intended, as a Drop-In-Module).
    Ineresting! But it reminds me a lot of my concept with the cWebArchive class:

    Code:
        Set htmlRes = New_c.WebArchive
        With htmlRes
            If App.LogMode = 0 Then
                .ReadContentsFromDirectory APP_PATH & "\Res\"
                .SaveContentsToArchiveFile APP_PATH & "\Res.war"
            Else
                .ReadContentsFromArchiveFile APP_PATH & "\Res.war"
            End If
        End With
    I use this in my WebView2 projects. In IDE mode, I can edit the HTML templates and load them from the Res folder (incl. edit&continue). In compiled mode, this data is in the *.war file supplied. This applies to all possible file types and works fine.

    Different *.war files can also be included for different languages.

    W. Wolf

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Jun 2013
    Posts
    7,253

    Re: VB6 ImageCaching and -Animation (using a single Resource-File for storage)

    Quote Originally Posted by wwolf View Post
    Ineresting! But it reminds me a lot of my concept with the cWebArchive class:
    Yes, the approach is quite similar to the cWebArchive-based resource-handling.
    FWIW, here is another (RC6-based) one, which follows the same basic principle:
    https://www.vbforums.com/showthread....ontainer-Files

    The difference with the demo here is, that RC5 or RC6 are not required...

    Olaf

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width