The DrawRect command is in fact drawing to the current buffer not the locked image and when you remove cls it no longer wipes the current buffer and so displays.
(And because you are using windowed mode, there is only one buffer so it does not flicker).
(And because you are using windowed mode, there is only one buffer so it does not flicker).