It records your Mouse movement and prints it on a Picture.
(This was actually a request in the IRC)
Code: Select all
#Persistent
#SingleInstance, force
OnExit, Exit
CoordMode,Mouse,Screen
SetBatchLines,-1
If !FileExist("Settings.ini")
{
GrowthSpeed := 5 ;How fast circles grow bigger
CheckInterval:= 5 ;Time in Milliseconds between checking the Mouse and redrawing the Picture
SaveInterval := 130000 ;Time in Milliseconds between a Save
RecolorSpeed := 10 ;How fast the color changes
IniWrite,%GrowthSpeed%,Settings.ini,General,GrowthSpeed
IniWrite,%CheckInterval%,Settings.ini,General,CheckInterval
IniWrite,%SaveInterval%,Settings.ini,General,SaveInterval
IniWrite,%RecolorSpeed%,Settings.ini,General,RecolorSpeed
FileAppend,
(
This Readme provides the basic information, needed to control the screen recording tool.
The Program will create a file named README.txt and Settings.ini.
The Settings can be found and changed in the Settings.ini
Values:
GrowthSpeed - Controls how fast circles grow.
Larger values mean circles grow faster.
Smaller values mean circles grow slower.
CheckInterval - Controls how accurate the Mouse should be recorded.
Sets the time in milliseconds between each drawing command.
Larger values mean less accurate results and less ressource usage.
Smaller values mean more accurate results and more ressource usage.
SaveInterval - Controls how often a picture is saved in Milliseconds.
I guess that one is self explinatory.
RecolorSpeed - Controls how fast it changes it's color.
Larger values mean that the color changes faster.
Smaller values mean that the color changes slower.
),README.txt
}
Else
{
IniRead,GrowthSpeed,Settings.ini,General,GrowthSpeed
IniRead,CheckInterval,Settings.ini,General,CheckInterval
IniRead,SaveInterval,Settings.ini,General,SaveInterval
IniRead,RecolorSpeed,Settings.ini,General,RecolorSpeed
}
pToken := Gdip_Startup()
pBitmap := Gdip_CreateBitmap(A_ScreenWidth+2,A_ScreenHeight+2)
pGraphics:= Gdip_GraphicsFromImage(pBitmap)
pBkgnd := Gdip_BrushCreateSolid(0xFF000000)
Gdip_FillRectangle(pGraphics, pBkgnd, 0, 0, A_ScreenWidth+2, A_ScreenHeight+2)
Gdip_DeleteBrush(pBkgnd)
MouseGetPos,OldX,OldY
PictureNr := 0
LastChange:= A_TickCount
LastUpdate:= A_TickCount-(1500/RecolorSpeed)*2
Unchanged := 1
FileRemoveDir,Pictures,1
FileCreateDir,Pictures
SetTimer,Redraw,% CheckInterval
SetTimer,Resave,% SaveInterval
Return
Redraw:
MouseGetPos,x,y
if !((x=OldX)&&(y=OldY))
{
UpdateBrushAndPen()
If ((Size:=(A_TickCount-LastChange)*GrowthSpeed/100000)>2)
Gdip_FillEllipse(pGraphics, pBrush, OldX-Size, OldY-Size, Size*2, Size*2)
Gdip_DrawLine(pGraphics, pPen, OldX+1, OldY+1, x+1, y+1)
OldX := X
OldY := Y
LastChange:= A_TickCount
}
return
Resave:
If ((Size:=(A_TickCount-LastChange)/1000)>2)
{
UpdateBrushAndPen()
Gdip_FillEllipse(pGraphics, pBrush, OldX-Size, OldY-Size, Size*2, Size*2)
}
Gdip_SaveBitmapToFile(pBitmap,"Pictures/PicNr" . PictureNr++ . ".png",100)
return
Exit:
Gdip_DeletePen(pPen)
Gdip_DeleteBrush(pBrush)
Gdip_DeleteGraphics(pGraphics)
Gdip_DisposeImage(pBitmap)
Gdip_Shutdown(pToken)
ExitApp
UpdateBrushAndPen()
{
global pBrush,pPen,LastUpdate,RecolorSpeed
static R:=255,G:=0,B:=0
If ((A_TickCount-LastUpdate)*RecolorSpeed/1500>1)
{
Gdip_DeletePen(pPen)
Gdip_DeleteBrush(pBrush)
Loop % floor((A_TickCount-LastUpdate)*RecolorSpeed/1500)
{
nR := (R+1)*(G+1)/(B+1)
nG := (G+1)*(B+1)/(R+1)
nB := (B+1)*(R+1)/(G+1)
nAV:= nR + nG + nB
nR := nR/nAV
nG := nG/nAV
nB := nB/nAV
wAV:= R+G+B
wR := R/wAV
wG := G/wAV
wB := B/wAV
R := nR*5+wR*250
G := nG*5+wG*250
B := nB*5+wB*250
}
LastUpdate := A_TickCount
pPen := Gdip_CreatePen(Gdip_ToARGB(255, R, G, B), 2)
pBrush := Gdip_BrushCreateSolid(Gdip_ToARGB(255, R, G, B))
}
}