Hi fred,
can you please run this benchmark with 4.31 vs 4.40 and then I promise I will stop bothering you with this issue
Code: Select all
; from the manual :
; If 'Depth' is omitted Or set To #PB_Image_DisplayFormat, the image format is taken from the desktop format.
; Valid 'Depth' values can be: 1, 2, 4, 8, 16, 24 And 32 Bits.
; When manipulating true colors formats, And want save back the modifications without color information loss, it's advised to use the 24 or 32 bits values.
; If the images are only used For displaying on the screen, #PB_Image_DisplayFormat will provide faster performances.
#Count=100
#NrOfDepts=8
#Width=800
#Height=600
Dim arrDepths.b(#NrOfDepts-1)
Dim arrSecs.d(#NrOfDepts-1)
arrDepths(0)=1:arrDepths(1)=2:arrDepths(2)=4:arrDepths(3)=8:arrDepths(4)=16:arrDepths(5)=24:arrDepths(6)=32:arrDepths(7)=#PB_Image_DisplayFormat
;Resize test
If QueryPerformanceFrequency_(@qFreq.q)
For d=0 To #NrOfDepts-1
QueryPerformanceCounter_(@qTimeA.q)
For i=1 To #Count
CreateImage(0,#Width,#Height, arrDepths(d)) ;32bits
ResizeImage(0,#Width/10,#Height/110)
FreeImage(0)
Next
QueryPerformanceCounter_(@qTimeZ.q)
arrSecs(d)=(qTimeZ-qTimeA)/qFreq
Next
szLabel.s="Resize..."+Chr(13)
For d=0 To #NrOfDepts-1
szLabel.s=szLabel+Str(arrDepths(d))+ "bits : "+StrD(arrSecs(d))+" secs"+Chr(13)
Next
EndIf
;SetgadgetState test"
If OpenWindow(0,0,0,#Width,#Height,"test")
For d=0 To #NrOfDepts-1
QueryPerformanceCounter_(@qTimeA.q)
CreateImage(0,#Width,#Height, arrDepths(d))
ImageGadget(0, 0, 0, #Width, #Height, ImageID(0))
For i=1 To #Count
SetGadgetState(0, ImageID(0))
Next
FreeGadget(0)
FreeImage(0)
QueryPerformanceCounter_(@qTimeZ.q)
arrSecs(d)=(qTimeZ-qTimeA)/qFreq
Next
szLabel.s=szLabel+"SetGadgetState..."+Chr(13)
For d=0 To #NrOfDepts-1
szLabel.s=szLabel+Str(arrDepths(d))+ "bits : "+StrD(arrSecs(d))+" secs"+Chr(13)
Next
MessageRequester("Result "+Str(#PB_Compiler_Version),szLabel)
EndIf