DrawAlphaImage: Speed much improved
Posted: Sat Sep 19, 2009 4:59 pm
I used the included code with PB v4.31 and with PB v4.40b3 and compared the results. The image is not small, 442*518. Your mileage may vary, but here's mine:
4.31 - 6000 ms or 15ms/draw
4.40 - 2798 ms or 7ms/draw
cutting the draw time by more than half.
I mainly constructed this test because while b3 was in development Freak said somewhere that Fred had optimized it. Imho - he's right!
4.31 - 6000 ms or 15ms/draw
4.40 - 2798 ms or 7ms/draw
cutting the draw time by more than half.
Code: Select all
InitNetwork()
If Not ReceiveHTTPFile("http://www.lloydsplace.com/babytuxalpha.png", GetTemporaryDirectory()+"babytuxalpha.png")
MessageRequester("oops...", "Can't download the image",#MB_ICONERROR)
EndIf
UsePNGImageDecoder()
LoadImage(0,GetTemporaryDirectory()+"babytuxalpha.png")
CreateImage(1, ImageWidth(0), ImageHeight(0))
t=ElapsedMilliseconds()
For i=1 To 400
StartDrawing(ImageOutput(1))
DrawAlphaImage(ImageID(0),0,0)
StopDrawing()
Next
MessageRequester("",Str(ElapsedMilliseconds()-t),$80)