Fibonacci word/fractal: Difference between revisions

Line 13:
=={{header|AutoHotkey}}==
Prints F_Word<sub>30</sub> currently. Segment length and F_Word<sub>n</sub> can be adjusted.
{{libheader|GDIP}}SomeAlso portionssee of code fromthe [http://www.autohotkey.com/board/topic/29449-gdi-standard-library-145-by-tic/ Gdip examples].
<lang AutoHotkey>SetBatchLines, -1#NoEnv
SetBatchLines, -1
; #MaxMem 200 ; Increased memory required for F_Word > 37
p := 0.3 ; Segment length (pixels)
F_Word := 30
 
SysGet, Mon, MonitorWorkArea
W := FibWord(F_Word), d := 1, x1 := 0, y1 := MonBottom
d := 1
, Width := A_ScreenWidth, Height := A_ScreenHeight
x1 := 0
y1 := MonBottom
Width := A_ScreenWidth
, Width := A_ScreenWidth, Height := A_ScreenHeight
 
If (!pToken := Gdip_Startup()) {
MsgBox, 48, gdiplusGdiplus errorError!, Gdiplus failed to start. Please ensure you have gdiplusGdiplus on your system.
ExitApp
}
OnExit, ExitShutdown
 
Gui, 1: -Caption +E0x80000 +LastFound +AlwaysOnTop +ToolWindow +OwnDialogs
Gui, 1: Show, NA
 
hwnd1 := WinExist(), hbm := CreateDIBSection(Width, Height), hdc := CreateCompatibleDC()
hbm := CreateDIBSection(Width, Height)
, obm := SelectObject(hdc, hbm), G := Gdip_GraphicsFromHDC(hdc), Gdip_SetSmoothingMode(G, 4)
hdc := CreateCompatibleDC()
, pPen := Gdip_CreatePen(0xffff0000, 1)
obm := SelectObject(hdc, hbm)
G := Gdip_GraphicsFromHDC(hdc)
Gdip_SetSmoothingMode(G, 4)
, pPen := Gdip_CreatePen(0xffff0000, 1)
 
Loop, Parse, W
Line 58 ⟶ 66:
}
 
Gdip_DeletePen(pPen), UpdateLayeredWindow(hwnd1, hdc, 0, 0, Width, Height)
UpdateLayeredWindow(hwnd1, hdc, 0, 0, Width, Height)
, SelectObject(hdc, obm), DeleteObject(hbm), DeleteDC(hdc), Gdip_DeleteGraphics(G)
SelectObject(hdc, obm)
DeleteObject(hbm)
DeleteDC(hdc)
Gdip_DeleteGraphics(G)
return
 
Line 69 ⟶ 81:
 
Esc::
Shutdown:
Exit:
Gdip_DeletePen(pPen), SelectObject(hdc, obm), DeleteObject(hbm)
SelectObject(hdc, obm)
, DeleteDC(hdc), Gdip_DeleteGraphics(G), Gdip_Shutdown(pToken)
DeleteObject(hbm)
DeleteDC(hdc)
Gdip_DeleteGraphics(G)
Gdip_Shutdown(pToken)
ExitApp</lang>
 
266

edits