Finally i work it out to print an image on the window