... some problems with dbp mem functions ... i use dot!
(thx monos)
on startup, few seconds lost
(no fullscreen)
Rem Project: DeskCopy © Dragonfly
Rem Created: 07.10.2002 21:16:11
Rem ***** Main Source File *****
load dll "user32.dll",1
load dll "gdi32.dll",2
sync on : sync rate 0
HORZRES = 8
VERTRES = 10
BITSPIXEL = 12
hWnd = call dll(1,"GetDesktopWindow")
hDC = call dll(1,"GetWindowDC",hWnd)
Width = call dll(2,"GetDeviceCaps",hDC,HORZRES)
Height = call dll(2,"GetDeviceCaps",hDC,VERTRES)
Depth = call dll(2,"GetDeviceCaps",hDC,BITSPIXEL)
set display mode Width,Height,Depth : set window layout 0,0,0
minimize window : lock pixels
for y=0 to Height-1
for x=0 to Width-1
ColVal = call dll(2,"GetPixel",hDC,x,y)
ColVal = rgbb(ColVal)*0.30+rgbg(ColVal)*0.59+rgbr(ColVal)*0.11
ink rgb(ColVal,ColVal,ColVal),0
dot x,y
next x
next y
call dll 1,"ReleaseDC",hWnd,hDC
unlock pixels : restore window
lock backbuffer
MemPtr = make memory((Width+100)*Height*Depth/8)
BackPtr = get backbuffer ptr()
for y=0 to Height-1
copy memory MemPtr+50*Depth/8+y*(Width+100)*Depth/8,BackPtr+y*Width*Depth/8,Width*Depth/8
next y
unlock backbuffer
repeat
lock backbuffer
for y=0 to Height-1
copy memory BackPtr+y*Width*Depth/8,MemPtr+50*Depth/8+y*(Width+100)*Depth/8+sin(y+a)*50*Depth/8,Width*Depth/8
next y
unlock backbuffer
a=wrapvalue(a+2)
text 0,0,"FPS: "+str$(screen fps())
sync
until mouseclick()
delete memory MemPrtr
delete dll 1
delete dll 2
end