Opps, I wasn't logged in when I posted the reply.
You can do other stuff by messing around with the radius and distance between the circles. Spiral in spiral out, make them catch up with each other and the likes. Samples here:
Code:
; gdi+ ahk tutorial 1 written by tic (Tariq Porter)
; Requires Gdip.ahk either in your Lib folder as standard library or using #Include
;
; Tutorial to draw a single ellipse and rectangle to the screen
#SingleInstance, Force
#NoEnv
SetBatchLines, -1
; Uncomment if Gdip.ahk is not in your standard library
;#Include, Gdip.ahk
; Start gdi+
If !pToken := Gdip_Startup()
{
MsgBox, 48, gdiplus error!, Gdiplus failed to start. Please ensure you have gdiplus on your system
ExitApp
}
OnExit, Exit
Origin_X:=100 ;Width//2
Origin_Y:=100 ;Height//2
Radius := 30
Radius_Max := 75
Radius_Min := 25
Direction := 1
Circle_Count := 9
Speed := 3.2 ; 0 = slooow, 100 = faaast
Gap := 32 ; 0 = overlapping, 100 = miles away
Circle_Step := 1.6 ; 0 = all same size, 5 = bigg difference
; Set the width and height we want as our drawing area, to draw everything in. This will be the dimensions of our bitmap
Width := Radius_Max+(Circle_Count*Circle_Step*2)+Origin_X, Height := Radius_Max+(Circle_Count*Circle_Step*2)+Origin_Y
; Create a layered window (+E0x80000 : must be used for UpdateLayeredWindow to work!) that is always on top (+AlwaysOnTop), has no taskbar entry or caption
Gui, 1: -Caption +E0x80000 +LastFound +AlwaysOnTop +ToolWindow +OwnDialogs
; Show the window
Gui, 1: Show, NA
; Get a handle to this window we have created in order to update it later
hwnd1 := WinExist()
SetTimer,My_Timer,100
Return
My_Timer:
; Create a gdi bitmap with width and height of what we are going to draw into it. This is the entire drawing area for everything
hbm := CreateDIBSection(Width, Height)
; Get a device context compatible with the screen
hdc := CreateCompatibleDC()
; Select the bitmap into the device context
obm := SelectObject(hdc, hbm)
; Get a pointer to the graphics of the bitmap, for use with drawing functions
G := Gdip_GraphicsFromHDC(hdc)
; Set the smoothing mode to antialias = 4 to make shapes appear smother (only used for vector drawing and filling)
Gdip_SetSmoothingMode(G, 4)
; Create a fully opaque red brush (ARGB = Transparency, red, green, blue) to draw a circle
pBrush := Gdip_BrushCreateSolid(0xffff0000)
pBrush1 := Gdip_BrushCreateSolid(0x20ff0000)
; Fill the graphics of the bitmap with an ellipse using the brush created
; Filling from coordinates (100,50) an ellipse of 200x300
Tx += 0.01745329252 * Speed ; degrees->radians
T := Tx
Radius := Radius + Direction
If ((Radius > Radius_Max) and (Direction > 0))
or ((Radius < Radius_Min) and (Direction < 0))
Direction := Direction * -1
Loop,%Circle_Count%
{
Circle_Size := Circle_Step * A_Index
; T += Circle_Size * Gap * 0.01745329252
T += Gap * 0.01745329252
OX := Radius*Cos(T)
OY := Radius*Sin(T)
Gdip_SetInterpolationMode(G,0)
Gdip_FillEllipse(G, pBrush, Origin_X+OX, Origin_Y+OY, Circle_Size, Circle_Size)
Gdip_FillEllipse(G, pBrush1, Origin_X+OX-(Circle_Size/2), Origin_Y+OY-(Circle_Size/2), Circle_Size, Circle_Size)
}
; Delete the brush as it is no longer needed and wastes memory
Gdip_DeleteBrush(pBrush)
Gdip_DeleteBrush(pBrush1)
; Update the specified window we have created (hwnd1) with a handle to our bitmap (hdc), specifying the x,y,w,h we want it positioned on our screen
; So this will position our gui at (0,0) with the Width and Height specified earlier
UpdateLayeredWindow(hwnd1, hdc, 0, 0, Width, Height)
; Select the object back into the hdc
SelectObject(hdc, obm)
; Now the bitmap may be deleted
DeleteObject(hbm)
; Also the device context related to the bitmap may be deleted
DeleteDC(hdc)
; The graphics may now be deleted
Gdip_DeleteGraphics(G)
Return
;#######################################################################
Exit:
; gdi+ may now be shutdown on exiting the program
Gdip_Shutdown(pToken)
ExitApp
Return