Home › Forums › TimelineFX Module › Error while executing my compiled vaders.exe › Re: Re: Error while executing my compiled vaders.exe
ok, so that eliminates it not extracting from the .eff file as “url” is not null, so it’s a problem with LoadImage not being able to load the stream properly. So the question is, what’s the difference between our PCs hehe.
Lets get back to basics, try running this code:
SuperStrict
Framework brl.max2d
Import gman.zipengine
Import brl.pixmap
Import brl.pngloader
Local zip:ZipWriter = New ZipWriter
zip.OpenZip("test.zip", False)
Local pixmap:TPixmap = CreatePixmap(32, 32, PF_RGBA8888)
pixmap.WritePixel(1, 1, $FFFFFFFF)
SavePixmapPNG(pixmap, "test.png")
'add the png to the zip
zip.AddFile("test.png")
zip.CloseZip()
'try and load them both back in again
Local ZipR:ZipReader = New ZipReader
ZipR.OpenZip("test.zip")
If Not ZipR RuntimeError "Couldn't open Zip file!"
Local tempstream:TStream = ZipR.ExtractFile("test.png")
If tempstream
DebugLog "Trying to load test.png"
Local image:TImage = LoadImage(tempstream)
If image
DebugLog "Image loaded ok!"
Else
DebugLog "Failed to load image!"
End If
Else
DebugLog "Failed to extract file!"
End If
tempstream.Close
ZipR.CloseZip()
End
That will simply create png file, add it to a zip file, extract it and try and load it, so if all works well then you should get an “Image loaded ok” message.