Fibonacci word/fractal: Difference between revisions
Content added Content deleted
m (→{{header|J}}) |
(→{{header|AutoHotkey}}: formatting) |
||
Line 13: | Line 13: | ||
=={{header|AutoHotkey}}== |
=={{header|AutoHotkey}}== |
||
Prints F_Word<sub>30</sub> currently. Segment length and F_Word<sub>n</sub> can be adjusted. |
Prints F_Word<sub>30</sub> currently. Segment length and F_Word<sub>n</sub> can be adjusted. |
||
{{libheader|GDIP}} |
{{libheader|GDIP}}Also see the [http://www.autohotkey.com/board/topic/29449-gdi-standard-library-145-by-tic/ Gdip examples]. |
||
<lang AutoHotkey> |
<lang AutoHotkey>#NoEnv |
||
SetBatchLines, -1 |
|||
; #MaxMem 200 ; Increased memory required for F_Word > 37 |
|||
p := 0.3 ; Segment length (pixels) |
p := 0.3 ; Segment length (pixels) |
||
F_Word := 30 |
F_Word := 30 |
||
SysGet, Mon, MonitorWorkArea |
SysGet, Mon, MonitorWorkArea |
||
W := FibWord(F_Word) |
W := FibWord(F_Word) |
||
d := 1 |
|||
⚫ | |||
x1 := 0 |
|||
y1 := MonBottom |
|||
Width := A_ScreenWidth |
|||
⚫ | |||
If (!pToken := Gdip_Startup()) { |
If (!pToken := Gdip_Startup()) { |
||
MsgBox, 48, |
MsgBox, 48, Gdiplus Error!, Gdiplus failed to start. Please ensure you have Gdiplus on your system. |
||
ExitApp |
ExitApp |
||
} |
} |
||
OnExit, |
OnExit, Shutdown |
||
Gui, 1: -Caption +E0x80000 +LastFound +AlwaysOnTop +ToolWindow +OwnDialogs |
Gui, 1: -Caption +E0x80000 +LastFound +AlwaysOnTop +ToolWindow +OwnDialogs |
||
Gui, 1: Show, NA |
Gui, 1: Show, NA |
||
hwnd1 := WinExist |
hwnd1 := WinExist() |
||
hbm := CreateDIBSection(Width, Height) |
|||
, obm := SelectObject(hdc, hbm), G := Gdip_GraphicsFromHDC(hdc), Gdip_SetSmoothingMode(G, 4) |
|||
hdc := CreateCompatibleDC() |
|||
⚫ | |||
obm := SelectObject(hdc, hbm) |
|||
G := Gdip_GraphicsFromHDC(hdc) |
|||
Gdip_SetSmoothingMode(G, 4) |
|||
⚫ | |||
Loop, Parse, W |
Loop, Parse, W |
||
Line 58: | Line 66: | ||
} |
} |
||
Gdip_DeletePen(pPen |
Gdip_DeletePen(pPen) |
||
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 |
return |
||
Line 69: | Line 81: | ||
Esc:: |
Esc:: |
||
Shutdown: |
|||
Exit: |
|||
Gdip_DeletePen(pPen |
Gdip_DeletePen(pPen) |
||
SelectObject(hdc, obm) |
|||
, DeleteDC(hdc), Gdip_DeleteGraphics(G), Gdip_Shutdown(pToken) |
|||
DeleteObject(hbm) |
|||
DeleteDC(hdc) |
|||
Gdip_DeleteGraphics(G) |
|||
Gdip_Shutdown(pToken) |
|||
ExitApp</lang> |
ExitApp</lang> |
||