' imgput() sample. RGB = (255, 0, 255) is transparent #include "imgputt.bi" #include "putex.bi" #define BPP 32 '#define BPP 16 '#define BPP 8 screenres 512, 288, BPP Dim As Any Ptr p = ImageCreate(101, 101) Select Case BPP Case 32 : Bload "sprite_24bit.bmp", p Case 16 : Bload "sprite_16bit.bmp", p Case 8 : Bload "sprite_8bit.bmp", p : color 16, 16 : cls End Select Dim As Double starttime, t0, t1, t2 Dim As Integer max_count = 3000 Sub sub1(ByVal max_count As Integer, ByVal p As Any Ptr) For i As Integer = 0 To max_count Put (10, 10), p, Trans ' Put (10, 10), p, Pset Next i End Sub Sub sub2(ByVal max_count As Integer, ByVal p As Any Ptr) For i As Integer = 0 To max_count 'imgputt( p, , 130, 10, TRANSFORM_HFLIP, 0 ) 'imgputt( p, , 130, 10, TRANSFORM_VFLIP, 0 ) imgputt( p, , 130, 10, TRANSFORM_HFLIP Or TRANSFORM_VFLIP, 0 ) Next i End Sub Sub sub3(ByVal max_count As Integer, ByVal p As Any Ptr) For i As Integer = 0 To max_count 'PutEx(10, 130, p, 0, 0, 101, 101, 1) 'PutEx(10, 130, p, 0, 0, 101, 101, 2) PutEx(10, 130, p, 0, 0, 101, 101, 3) Next i End Sub starttime = Timer ScreenLock sub1(max_count, p) ScreenUnlock t0 = Timer - starttime sleep 1000 starttime = Timer ScreenLock sub2(max_count, p) ScreenUnlock t1 = Timer - starttime sleep 1000 starttime = Timer ScreenLock sub3(max_count, p) ScreenUnlock t2 = Timer - starttime sleep 1000 Print "Put : " & t0 & " sec (100%)" Print "imgputt : " & t1 & " sec (" & int((t1 / t0) * 100) & "%)" Print "PutEx : " & t2 & " sec (" & int((t2 / t0) * 100) & "%)" imagedestroy p sleep