Thank you Peter!
Regarding to the background image, I noticed that it is just placed over the existing image.
You will see it, if you change the style to "no-repeat".
Code: Select all
Procedure SetBackgroundImage (Url.s, NoRepeat = #False)
Protected Size.s
Url = "url('" + Url + "')"
If NoRepeat = #True
If ExamineDesktops()
Size = Str(DesktopWidth(0)) + "px " + Str(DesktopHeight(0)) + "px"
EndIf
! document.body.style.backgroundRepeat = "no-repeat";
; ! document.body.style.backgroundSize = v_size;
EndIf
! document.body.style.backgroundImage = v_url;
EndProcedure
;
Procedure CloseWindowEvent()
Debug "Closing window: " + EventWindow()
CloseWindow(EventWindow()) ; Close the specific window
EndProcedure
OpenWindow(0, 100, 100, 320, 200, "Window 0 - Resizable", #PB_Window_BorderLess)
SetBackgroundImage ("https://www.purebasic.com/img/bg-page-header.jpg", #True)
BindEvent(#PB_Event_CloseWindow, @CloseWindowEvent())
Does this mean that changing the background several times can result in memory overflow?