Does anyone know of how this might be made even faster with API?
Code: Select all
OpenWindow(0,0,0,320,240,"WinTitle",#PB_Window_SizeGadget)
CreateGadgetList(WindowID(0))
CreateImage(image,20,20,32)
ImageGadget(imagegadget,0,0,50,50,ImageID(image))
ResizeImage(image,40,40)
SetGadgetState(imagegadget,ImageID(image))
Procedure WinCallback(hWnd, uMsg, wParam, lParam)
Result=#PB_ProcessPureBasicEvents
Select uMsg
Case #WM_SIZING
width=WindowWidth(0)
height=WindowHeight(0)
If width<=0
width=1
EndIf
If height<=0
height=1
EndIf
;ResizeImage(image,width,height) ; slow
CreateImage(image,width,height) ; fast
StartDrawing(ImageOutput(image))
Box(0,0,width,height,RGB(79,79,79))
StopDrawing()
SetGadgetState(imagegadget,ImageID(image))
EndSelect
ProcedureReturn Result
EndProcedure
SetWindowCallback(@WinCallback())
Repeat
WaitWindowEvent()
ForEver