SetBuffer DesktopBuffer()
Global imagebackground=CreateImage( 773,600 )
GrabImage imagebackground,GraphicsWidth()/2-386,GraphicsHeight()/2-300
windowx = (GraphicsWidth()/2-(773/2))
windowy = (GraphicsHeight()/2-(600/2))
window = CreateWindow ("Game",windowx,windowy,773,600,Desktop(),0)
canvas = CreateCanvas (0, 0, ClientWidth (window), ClientHeight (window), window)
SetGadgetLayout canvas, 1, 1, 1, 1
SetBuffer CanvasBuffer (canvas)
While Not KeyHit(1)
DrawBlock imagebackground,0,0
FlipCanvas (canvas)
Cls
Wend
;-----------------------------------
;-----------------------------------
;-----------------------------------
;-----------------------------------
;-----------------------------------
;-----------------------------------
;-----------------------------------
;-----------------------------------
The above code is a simplified version on code that creates a "transparent" background for my app. I was wondering if anyone had an idea of a way to make it update. Currently if you leave the window and change anything behind the app, nothing lines up in the screenshot anymore. So if anyone has ideas of how to make it update they would be gladly appreciated.
Global imagebackground=CreateImage( 773,600 )
GrabImage imagebackground,GraphicsWidth()/2-386,GraphicsHeight()/2-300
windowx = (GraphicsWidth()/2-(773/2))
windowy = (GraphicsHeight()/2-(600/2))
window = CreateWindow ("Game",windowx,windowy,773,600,Desktop(),0)
canvas = CreateCanvas (0, 0, ClientWidth (window), ClientHeight (window), window)
SetGadgetLayout canvas, 1, 1, 1, 1
SetBuffer CanvasBuffer (canvas)
While Not KeyHit(1)
DrawBlock imagebackground,0,0
FlipCanvas (canvas)
Cls
Wend
;-----------------------------------
;-----------------------------------
;-----------------------------------
;-----------------------------------
;-----------------------------------
;-----------------------------------
;-----------------------------------
;-----------------------------------
The above code is a simplified version on code that creates a "transparent" background for my app. I was wondering if anyone had an idea of a way to make it update. Currently if you leave the window and change anything behind the app, nothing lines up in the screenshot anymore. So if anyone has ideas of how to make it update they would be gladly appreciated.