'''''''''''
#Include "Inc\FB_ScreenSaverKit.bas"
#Libpath "lib"
#Include Once "inc\fbpng.bi"
#Include Once "inc\incfile.bi"
#Include Once "inc\png_image.bi"

IncFile(pnginmem, "Res/fhc.png", true) 
Dim As Any ptr thimg=png_load_mem(pnginmem,pnginmem_len,PNG_TARGET_FBNEW)

Type dot
	x As double
	y As double
	stepx As double
	stepy As double
	col As Integer
	Declare Constructor()
	Declare Constructor(x As double,y As double)
	Declare Sub ReDraw()
End Type

Constructor dot():End Constructor
Constructor dot(x As double,y As double)
	this.x=x
	this.y=y
End Constructor
Sub dot.ReDraw()
	x+=stepx
	y+=stepy
	If x>SaverInfo.ScrWidth Then
		x=0
	EndIf
	If y>SaverInfo.ScrHeight Then
		y=0
	EndIf
	PSet (x,y),RGB(255,255,255)
End Sub

StartScreenSaver

Dim dots(0 To 10000) As dot

Dim i As Integer
For i=LBound(dots) To UBound(dots)
	dots(i).x=(Rnd*SaverInfo.ScrWidth)
	dots(i).y=(Rnd*SaverInfo.ScrHeight)
	dots(i).stepx=Rnd*(Rnd*2)+(Rnd*-1)
	dots(i).stepy=Rnd*(Rnd*2)+(Rnd*-1)
	If dots(i).stepx=0 Then
		dots(i).stepx=1
	EndIf
	If dots(i).stepy<0.5 Then
		dots(i).stepy=0.5
	EndIf
Next





Dim As Any ptr img=imagecreate(SaverInfo.ScrWidth,SaverInfo.ScrHeight)
Line img,(0,0)-(SaverInfo.ScrWidth,SaverInfo.ScrHeight),RGB(0,0,255),BF
Put img,(0,0),thimg,ALPHA 


'
Do Until SaverInfo.IsClosing = TRUE
	Put (0,0),img ,Alpha
	For i=LBound(dots) To UBound(dots)
		dots(i).ReDraw() 
	Next
	Sleep 1
	'Line (Rnd*SaverInfo.ScrWidth,Rnd*SaverInfo.ScrHeight)-(Rnd*SaverInfo.ScrWidth,Rnd*SaverInfo.ScrHeight),RGBA(255,0,255,125)
Loop
''''''''''