Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Question about load pictures
#3
Zip and other similar archive formats are not natively supported. You could write a wrapper around something like PhysicsFS which then loads the file to a STRING buffer and use the memory load feature like Gets explained above.

If you are using a custom archive format with no compression and know the file offset and size, then you could simply do:

Code: (Select All)
FUNCTION LoadEmbeddedImage& (archiveFileHandle AS LONG, embeddedFileOffset AS LONG, embeddedFileSize AS LONG)
    IF embeddedFileSize > 0 _ANDALSO embeddedFileOffset > 0 THEN
        IF LOF(archiveFileHandle) < embeddedFileOffset + embeddedFileSize THEN
            EXIT FUNCTION
        END IF

        DIM buffer AS STRING: buffer = SPACE$(embeddedFileSize)
        SEEK #archiveFileHandle, embeddedFileOffset
        GET #archiveFileHandle, , buffer

        LoadEmbeddedImage = _LOADIMAGE(buffer, 32, "memory")
    END IF
END FUNCTION
Reply


Messages In This Thread
Question about load pictures - by Jim_001 - 10-21-2025, 03:41 PM
RE: Question about load pictures - by Gets - 10-21-2025, 04:33 PM
RE: Question about load pictures - by a740g - 10-21-2025, 05:31 PM
RE: Question about load pictures - by Jim_001 - 10-21-2025, 06:08 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  a question about OpenGL in QB64pe: TempodiBasic 11 1,802 11-22-2025, 05:47 PM
Last Post: TempodiBasic
  Test to post a new Thread + question 32 or 64 bit Rudy M 2 538 09-09-2025, 04:10 PM
Last Post: Rudy M
  Quick Question (I hope) bplus 3 698 02-26-2025, 01:14 AM
Last Post: SMcNeill
  Mix mode input of a binary open file Question! doppler 5 1,463 11-28-2024, 03:06 PM
Last Post: Petr
  History of the question mark Dimster 8 1,537 07-11-2024, 10:45 PM
Last Post: Pete

Forum Jump:


Users browsing this thread: