You have to repaint the graphic on erase. I found an old script:
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include <ScreenCapture.au3>
Opt("GUIOnEventMode", 1)
Global $iW = 500, $iH = 500
Global Const $hGUI = GUICreate("test", $iW, $iH, -1, -1, BitOR($GUI_SS_DEFAULT_GUI, $WS_SIZEBOX))
GUISetState()
GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit", $hGUI)
_GDIPlus_Startup()
Global Const $hBitmap = _GDIPlus_BitmapCreateFromMemory(InetRead("https://i.imgur.com/ZxOCPa3.jpg"))
GUIRegisterMsg($WM_SIZE, "WM_SIZE")
GUIRegisterMsg($WM_ERASEBKGND, "WM_ERASEBKGND")
WM_SIZE($hGUI, $WM_SIZE, 0, 0)
_WinAPI_RedrawWindow($hGUI)
While Sleep(1000)
WEnd
Func WM_SIZE($hWnd, $Msg, $wParam, $lParam)
#forceref $hWnd, $Msg, $wParam, $lParam
Local Const $aWidth = WinGetClientSize($hGUI)
$iW = $aWidth[0]
$iH = $aWidth[1]
Return "GUI_RUNDEFMSG"
EndFunc ;==>WM_SIZE
Func WM_ERASEBKGND($hWnd, $Msg, $wParam, $lParam)
#forceref $hWnd, $Msg, $lParam
Local Const $hGfx = _GDIPlus_GraphicsCreateFromHDC($wParam)
_GDIPlus_GraphicsClear($hGfx, 0xFFFFFFFF)
_GDIPlus_GraphicsSetInterpolationMode($hGfx, 1)
_GDIPlus_GraphicsDrawImageRect($hGfx, $hBitmap, 0, 0, $iW, $iH)
_GDIPlus_GraphicsDispose($hGfx)
Return True
EndFunc ;==>WM_ERASEBKGND
Func _Exit()
GUIRegisterMsg($WM_ERASEBKGND, "")
GUIRegisterMsg($WM_SIZE, "")
_GDIPlus_BitmapDispose($hBitmap)
_GDIPlus_Shutdown()
GUIDelete()
Exit
EndFunc ;==>_Exit