10-21-2025, 05:31 PM
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:
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


