Here's something I've been toying with ..
Can you improve the effect?
Code: Select all
; melt1
#win=0
#lineH=40
sw.l=GetSystemMetrics_(#SM_CXSCREEN)
sh.l=GetSystemMetrics_(#SM_CYSCREEN)+#lineH
;- setup window
If OpenWindow(#win, 0, -#lineH, sw, sh, "", #PB_Window_BorderLess)
AddKeyboardShortcut(#win, #PB_Shortcut_Escape, #PB_Shortcut_Escape)
Else
MessageRequester("Error","unable to open window")
End
EndIf
StartDrawing(WindowOutput(#win))
Box(0,0,sw,sh,RGB($ff,$ff,$ff))
StopDrawing()
Global hWnd1,hWnd2,DC1,DC2
hWnd1=WindowID(0)
hWnd2=WindowID(0)
DC1=GetWindowDC_(hWnd1)
DC2=GetWindowDC_(hWnd2)
Procedure DrawLines()
Shared sw,sh
StartDrawing(WindowOutput(#win))
For l=1 To 50
FrontColor(RGB(Random(255),Random(255),Random(255)))
LineXY(Random(sw),Random(#lineH),Random(sw),Random(#lineH))
Next
StopDrawing()
EndProcedure
Procedure Melt(effect.l)
Shared sw,sh
rW=Random(sw/4)+10 : rH=Random(200)+8
rX=Random(sw+8)-16 : rY=Random(sh)
shX=Random(1)-Random(1)
BitBlt_(DC2,rX+shX,rY+Random(4)+1,rW,rH,DC1,rX,rY,effect)
EndProcedure
ShowCursor_(0)
Repeat
count-1
If count<=0
DrawLines()
count=20
EndIf
For m=1 To 20
Melt(#SRCCOPY)
Next
Delay(1)
If mouse-(mouse>0)
ev = WindowEvent()
If ev=#WM_CHAR : Break : EndIf
If ev=#WM_MOUSEMOVE
mouse+1
If mouse=12 : Break : EndIf
EndIf
EndIf
ForEver
ReleaseDC_(hWnd1,DC1)
ReleaseDC_(hWnd2,DC2)
ShowCursor_(1)
End #BLACKNESS
#DSTINVERT
#MERGECOPY
#MERGEPAINT
#NOTSRCCOPY
#NOTSRCERASE
#PATCOPY
#PATINVERT
#PATPAINT
#SRCAND
#SRCCOPY
#SRCERASE
#SRCINVERT
#SRCPAINT
#WHITENESS




