Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

[Script] tomoe_uehara's home made =)


  • Please log in to reply
69 replies to this topic
tidbit
  • Administrators
  • 2709 posts
  • Hates playing Janitor
  • Last active: Jan 15 2016 11:37 PM
  • Joined: 09 Mar 2008
I find that really cool and useful! I think I can even understand the GDI stuff too :O !
Awesome!

minor nitpick: is there now way to remove the effect(s) without exiting the script?

ideas:
* Add a slider to control the transparency without the gui open?
* You could probably add some other cool features, like that GDI_Grayscale or a feature or 2 (such as invert colors) from Color Zoomer.

rawr. be very afraid
*poke*
. Populate the AutoHotkey city. Pointless but somewhat fun. .


tomoe_uehara
  • Members
  • 2166 posts
  • Last active: Jun 11 2015 05:33 PM
  • Joined: 05 Sep 2009
Okay, I'll try to tweak the code..

tomoe_uehara
  • Members
  • 2166 posts
  • Last active: Jun 11 2015 05:33 PM
  • Joined: 05 Sep 2009

[Lib] Garlic -- A simplified version of GDI+

Put this Garlic.ahk and tic's gdip.ahk into your lib folder.

Garlic_Start()
{
global
If !pToken := Gdip_Startup()
{
MsgBox, 48, gdiplus error!, Gdiplus failed to start. Please ensure you have gdiplus on your system
ExitApp
}
ww := A_ScreenWidth, hh := A_ScreenHeight
Gui, 1: -Caption +E0x80000 +E0x20 +LastFound +OwnDialogs +Owner +AlwaysOnTop
Gui, 1: Add, Pic, hwndPic
Random, Random, 10000, 99999
Gui, 1: Show, NA, Canvas%Random%
hwnd1 := WinExist()
hbm := CreateDIBSection(ww, hh)
hdc := CreateCompatibleDC()
obm := SelectObject(hdc, hbm)
G := Gdip_GraphicsFromHDC(hdc)
Gdip_SetSmoothingMode(G, 4)
ddc := GetDC(pic)
}

Garlic_Arc(Pen, Thickness="", Style=0, x="", y="", w="", h="", StartAngle="", SweepAngle="")
{
global
StartAngle2 := StartAngle-90
if (Thickness = "")
Thickness := 1
pPen := Gdip_CreatePen(Pen, Thickness)
; By HotKeyIt (http://www.autohotkey.com/community/viewtopic.php?f=1&t=89379)
DllCall("Gdiplus.dll\GdipSetPenDashStyle", "uint", pPen, "Int", Style)
Gdip_DrawArc(G, pPen, x, y, w, h, StartAngle2, SweepAngle)
Gdip_DeletePen(pPen)
}

Garlic_Bezier(Pen, Thickness="", Style=0, x1="", y1="", x2="", y2="", x3="", y3="", x4="", y4="")
{
global
if (Thickness = "")
Thickness := 1
pPen := Gdip_CreatePen(Pen, Thickness)
DllCall("Gdiplus.dll\GdipSetPenDashStyle", "uint", pPen, "Int", Style)
Gdip_DrawBezier(G, pPen, x1, y1, x2, y2, x3, y3, x4, y4)
Gdip_DeletePen(pPen)
}

Garlic_Ellipse(Pen, Thickness="", Style=0, x="", y="", w="", h="")
{
global
if (Thickness = "")
Thickness := 1
pPen := Gdip_CreatePen(Pen, Thickness)
DllCall("Gdiplus.dll\GdipSetPenDashStyle", "uint", pPen, "Int", Style)
Gdip_DrawEllipse(G, pPen, x, y, w, h)
Gdip_DeletePen(pPen)
}

Garlic_Image(File, dx="", dy="", dw="", dh="", sx="", sy="", sw="", sh="", Matrix="")
{
global
if Matrix=Negative
Matrix=-1|0|0|0|0|0|-1|0|0|0|0|0|-1|0|0|0|0|0|1|0|0|0|0|0|1
if Matrix=Bright
Matrix=1.5|0|0|0|0|0|1.5|0|0|0|0|0|1.5|0|0|0|0|0|1|0|0.05|0.05|0.05|0|1
if Matrix=Darken
Matrix=0.5|0|0|0|0|0|0.5|0|0|0|0|0|0.5|0|0|0|0|0|1|0|-0.05|-0.05|-0.05|0|1
if Matrix=Greyscale
Matrix=0.299|0.299|0.299|0|0|0.587|0.587|0.587|0|0|0.114|0.114|0.114|0|0|0|0|0|1|0|0|0|0|0|1
if Matrix=NoRed
Matrix=0|0|0|0|0|0|1|0|0|0|0|0|1|0|0|0|0|0|1|0|0|0|0|0|1
if Matrix=NoGreen
Matrix=1|0|0|0|0|0|0|0|0|0|0|0|1|0|0|0|0|0|1|0|0|0|0|0|1
if Matrix=NoBlue
Matrix=1|0|0|0|0|0|1|0|0|0|0|0|0|0|0|0|0|0|1|0|0|0|0|0|1
if Matrix=DoubleRed
Matrix=2|0|0|0|0|0|1|0|0|0|0|0|0|0|0|0|0|0|1|0|0|0|0|0|1
if Matrix=""
Matrix=1
pBitmap := Gdip_CreateBitmapFromFile(File)
if (dw="") && (dh="")
Gdip_GetDimensions(pBitmap, dw, dh)
if (sw="") && (sh="")
Gdip_GetDimensions(pBitmap, sw, sh)
Gdip_DrawImage(G, pBitmap, dx, dy, dw, dh, sx, sy, sw, sh, Matrix)
Gdip_DisposeImage(pBitmap)
}

Garlic_ImageSkew(File, Points)
{
global
if Matrix=Negative
Matrix=-1|0|0|0|0|0|-1|0|0|0|0|0|-1|0|0|0|0|0|1|0|0|0|0|0|1
if Matrix=Bright
Matrix=1.5|0|0|0|0|0|1.5|0|0|0|0|0|1.5|0|0|0|0|0|1|0|0.05|0.05|0.05|0|1
if Matrix=Darken
Matrix=0.5|0|0|0|0|0|0.5|0|0|0|0|0|0.5|0|0|0|0|0|1|0|-0.05|-0.05|-0.05|0|1
if Matrix=Greyscale
Matrix=0.299|0.299|0.299|0|0|0.587|0.587|0.587|0|0|0.114|0.114|0.114|0|0|0|0|0|1|0|0|0|0|0|1
if Matrix=NoRed
Matrix=0|0|0|0|0|0|1|0|0|0|0|0|1|0|0|0|0|0|1|0|0|0|0|0|1
if Matrix=NoGreen
Matrix=1|0|0|0|0|0|0|0|0|0|0|0|1|0|0|0|0|0|1|0|0|0|0|0|1
if Matrix=NoBlue
Matrix=1|0|0|0|0|0|1|0|0|0|0|0|0|0|0|0|0|0|1|0|0|0|0|0|1
if Matrix=DoubleRed
Matrix=2|0|0|0|0|0|1|0|0|0|0|0|0|0|0|0|0|0|1|0|0|0|0|0|1
if Matrix=""
Matrix=1
pBitmap := Gdip_CreateBitmapFromFile(File)
Gdip_DrawImagePointsRect(G, pBitmap, Points)
Gdip_DisposeImage(pBitmap)
}

Garlic_Line(Pen, Thickness="", Style=0, x1="", y1="", x2="", y2="")
{
global
if (Thickness = "")
Thickness := 1
pPen := Gdip_CreatePen(Pen, Thickness)
DllCall("Gdiplus.dll\GdipSetPenDashStyle", "uint", pPen, "Int", Style)
Gdip_DrawLine(G, pPen, x1, y1, x2, y2)
Gdip_DeletePen(pPen)
}

Garlic_Lines(Pen, Thickness="", Style=0, Points="")
{
global
if (Thickness = "")
Thickness := 1
pPen := Gdip_CreatePen(Pen, Thickness)
DllCall("Gdiplus.dll\GdipSetPenDashStyle", "uint", pPen, "Int", Style)
Gdip_DrawLines(G, pPen, Points)
Gdip_DeletePen(pPen)
}

Garlic_Pie(Pen, Thickness="", Style=0, x="", y="", w="", h="", StartAngle="", SweepAngle="")
{
global
StartAngle2 := StartAngle-90
if (Thickness = "")
Thickness := 1
pPen := Gdip_CreatePen(Pen, Thickness)
DllCall("Gdiplus.dll\GdipSetPenDashStyle", "uint", pPen, "Int", Style)
Gdip_DrawPie(G, pPen, x, y, w, h, StartAngle2, SweepAngle)
Gdip_DeletePen(pPen)
}

Garlic_Rectangle(Pen, Thickness="", Style=0, x="", y="", w="", h="")
{
global
if (Thickness = "")
Thickness := 1
pPen := Gdip_CreatePen(Pen, Thickness)
DllCall("Gdiplus.dll\GdipSetPenDashStyle", "uint", pPen, "Int", Style)
Gdip_DrawRectangle(G, pPen, x, y, w, h)
Gdip_DeletePen(pPen)
}

Garlic_RoundedRectangle(Pen, Thickness="", Style=0, x="", y="", w="", h="", r="")
{
global
if (Thickness = "")
Thickness := 1
pPen := Gdip_CreatePen(Pen, Thickness)
DllCall("Gdiplus.dll\GdipSetPenDashStyle", "uint", pPen, "Int", Style)
Gdip_DrawRoundedRectangle(G, pPen, x, y, w, h, r)
Gdip_DeletePen(pPen)
}

Garlic_Text(Text, Options, w="", h="")
{
global
Gdip_TextToGraphics(G, Text, Options, "Arial", w, h, Measure=0)
}

Garlic_BrushSolid(Brush)
{
global
pBrush := Gdip_BrushCreateSolid(Brush)
}

Garlic_BrushHatch(Front, Back, HatchStyle)
{
global
pBrush := Gdip_BrushCreateHatch(Front, Back, HatchStyle)
}

Garlic_BrushLine(Front, Back, x, y, w, h)
{
global
pBrush := Gdip_CreateLineBrush(x, y, w, h, Front, Back)
}

Garlic_FillEllipse(x, y, w, h)
{
global
Gdip_FillEllipse(G, pBrush, x, y, w, h)
Gdip_DeleteBrush(pBrush)
}

/* Not used
Garlic_PathEllipse(x, y, w, h)
{
global
pPath := Gdip_CreatePath(G)
Gdip_AddPathEllipse(pPath, x, y, w, h)
Gdip_FillPath(G, pBrush, pPath)
Gdip_DeleteBrush(pBrush)
}

Garlic_PathPolygon(Points)
{
global
pPath := Gdip_CreatePath(G)
Gdip_AddPathPolygon(pPath, Points)
Gdip_FillPath(G, pBrush, pPath)
Gdip_DeleteBrush(pBrush)
}
*/

Garlic_FillPie(x, y, w, h, StartAngle, SweepAngle)
{
global
StartAngle2 := StartAngle-90
Gdip_FillPie(G, pBrush, x, y, w, h, StartAngle2, SweepAngle)
Gdip_DeleteBrush(pBrush)
}

Garlic_FillPolygon(Points)
{
global
if FillMode=""
FillMode=0
Gdip_FillPolygon(G, pBrush, Points, FillMode=0)
Gdip_DeleteBrush(pBrush)
}

Garlic_FillRectangle(x, y, w, h)
{
global
Gdip_FillRectangle(G, pBrush, x, y, w, h)
Gdip_DeleteBrush(pBrush)
}

Garlic_FillRoundedRectangle(x, y, w, h, r)
{
global
Gdip_FillRoundedRectangle(G, pBrush, x, y, w, h, r)
Gdip_DeleteBrush(pBrush)
}

Garlic_Draw()
{
global
UpdateLayeredWindow(hwnd1, hdc, 0, 0, ww, hh)
}

Garlic_Clear()
{
global
Gdip_GraphicsClear(G)
}

Garlic_Stop()
{
global
SelectObject(hdc, obm)
DeleteObject(hbm)
DeleteDC(hdc)
Gdip_DeleteGraphics(G)
Gdip_Shutdown(pToken)
}
And here's the test script to see how it works. (Just remove the comment to make it work)
#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%
SetBatchLines, -1

#Include, Garlic.ahk ;Uncomment if you put Garlic.ahk in your lib folder.
Garlic_Start()
MidX := (A_ScreenWidth/2)
MidY := (A_ScreenHeight/2)

Goto Arc
;Goto Bezier
;Goto Ellipse
;Goto Image
;Goto ImageSkew
;Goto Line
;Goto Lines
;Goto Pie
;Goto Rectangle
;Goto Text
;Goto FillEllipse
;Goto FillPie
;Goto FillPolygon
;Goto FillRectangle
return

Arc:
aa1:=290
bb1:=70
aa2:=250
bb2:=60
aa3:=90
bb3:=200
aa4:=0
bb4:=110
aa5:=40
Loop
{
Garlic_Clear()
if aa1 < 360
aa1++
else
aa1:=0
aa2--
if aa2 < 0
aa2:=360
if aa3 < 360
aa3+=3
else
aa3:=0
aa4-=2
if aa4 < 0
aa4:=360
aa5+=4
if aa5 > 360
aa5=0

Garlic_Arc(0xffff0000, 5, 4, MidX-225, MidY-225, 450, 450, aa1, bb1)
Garlic_Arc(0x6600ff00, 40, 2, MidX-200, MidY-200, 400, 400, aa2, bb2)
Garlic_Arc(0x330000ff, 50, 0, MidX-220, MidY-220, 440, 440, aa3, bb3)
Garlic_Arc(0x99ffff00, 20, 1, MidX-200, MidY-200, 400, 400, aa4, bb4)
Garlic_Arc(0x66ff00ff, 70, 0, MidX-100, MidY-100, 200, 200, aa3, bb4)
Garlic_Arc(0x66ffccff, 40, 3, MidX-100, MidY-100, 200, 200, aa1, bb3)
Garlic_Arc(0xff00ff00, 2, 0, MidX-80, MidY-80, 160, 160, aa1+180, bb3)
Garlic_Draw()
Sleep 50
}
return

Bezier:
Garlic_Bezier(0xffff0000, 5, 0, 0, 0, 700, 200, 300, 600, ww, hh)
Garlic_Bezier(0xff00ff00, 5, 1, 0, MidY, ww*0.3, 0, ww*0.7, hh, ww, MidY)
Garlic_Bezier(0xff0000ff, 5, 2, 0, hh, 200, 600, 600, 200, ww, hh)
Garlic_Draw()
return

Ellipse:
Garlic_Ellipse(0xffff0000, 10, 0, 500, 200, 400, 200)
Garlic_Ellipse(0xff00ff00, 4, 4, 500, 200, 200, 400)
Garlic_Draw()
return

Image:
Garlic_Image("file1.png", 0, 0, 200, 200, 0, 0, 100, 100)
Garlic_Draw()
Sleep 1000
Garlic_Image("file1.png", 200, 0, 200, 200)
Garlic_Draw()
Sleep 1000
Garlic_Image("file1.png", 400, 0, 200, 200, 0, 0, 200, 200, "Bright")
Garlic_Draw()
Sleep 1000
Garlic_Image("file1.png", 600, 0, 200, 200, 0, 0, 200, 200, "Greyscale")
Garlic_Draw()
Sleep 1000
Garlic_Image("file1.png", 800, 0, 200, 200, 0, 0, 200, 200, "Negative")
Garlic_Draw()
Sleep 1000
Garlic_Image("file1.png", 0, 200, 200, 200, 0, 0, 200, 200, "NoRed")
Garlic_Draw()
Sleep 1000
Garlic_Image("file1.png", 200, 200, 200, 200, 0, 0, 200, 200, "NoGreen")
Garlic_Draw()
Sleep 1000
Garlic_Image("file1.png", 400, 200, 200, 200, 0, 0, 200, 200, "NoBlue")
Garlic_Draw()
Sleep 1000
Garlic_Image("file1.png", 600, 200, 200, 200, 0, 0, 200, 200, "DoubleRed")
Garlic_Draw()
Sleep 1000
Garlic_Image("file1.png", 800, 200, 200, 200, 0, 0, 200, 200, "Darken")
Garlic_Draw()
return

ImageSkew:
Options = x0 y0 cff00ffff s14
Garlic_Text("<-- Point 1`n0,0", Options, 400, 200)
Options = x150 y150 cff00ffff s14
Garlic_Text("<-- Point 2`n150,150", Options, 400, 200)
Options = x0 y150 cff00ffff s14
Garlic_Text("<-- Point 3`n0,150", Options, 400, 200)
Garlic_ImageSkew("file1.png", "0,0|150,150|0,150")
Garlic_Lines(0x99ffff00, 3, 1, "0,0|150,150|150,300|0,150|0,0")
Garlic_Draw()
Sleep 1000
Garlic_ImageSkew("file1.png", "200,200|350,200|200,350")
Garlic_Lines(0x99ffff00, 3, 1, "200,200|350,200|350,350|200,350|200,200")
Garlic_Draw()
Sleep 1000
Points=500,300|500,200|400,300
Garlic_ImageSkew("file1.png", Points)
Garlic_Lines(0x99ffff00, 3, 1, "500,300|500,200|400,200|400,300|500,300")
Garlic_Draw()
return

Line:
Garlic_Line(0xff0000ff, 10, 0, 0, 0, ww, hh)
Garlic_Line(0xff0000ff, 10, 0, 0, hh, ww, 0)
Garlic_Draw()
Sleep 1000
Loop
{
Garlic_Clear()
Random, output, 111111, 999999
output2 = 0xff%output%
Garlic_Line(output2, 10, 0, 0, 0, ww, hh)
Random, output, 111111, 999999
output2 = 0xff%output%
Garlic_Line(output2, 10, 0, 0, hh, ww, 0)
Garlic_Draw()
Sleep 1000
}
return

Lines:
Points=300,100|500,100|600,200|400,400|200,200|300,100
Garlic_Lines(0xffff0000, 10, 0, Points)
Points=450,150|350,200|450,250|350,300
Garlic_Lines(0xff0000ff, 20, 0, Points)
Garlic_Draw()
return

Pie:
aa1:=120
bb1:=300
Garlic_Pie(0xffff0000, 5, 0, 500, 200, 400, 400, 0, 90)
Garlic_Draw()
Sleep 1000
Garlic_Clear()
Garlic_Pie(0xff00ff00, 5, 1, 500, 200, 400, 400, 45, 90)
Garlic_Draw()
Sleep 1000
Garlic_Clear()
Garlic_Pie(0xff0000ff, 5, 2, 500, 200, 400, 400, 90, 90)
Garlic_Draw()
Sleep 1000
Garlic_Clear()
Garlic_Pie(0xffff0000, 5, 3, 500, 200, 400, 400, 120, 300)
Garlic_Ellipse(0xffff0000, 5, 1, 730, 260, 40, 40)
Garlic_Draw()
Loop
{
Loop, 25
{
Garlic_Clear()
aa1--
bb1+=2
Garlic_Pie(0xffff9900, 5, 0, 500, 200, 400, 400, aa1, bb1)
Garlic_Ellipse(0xffff9900, 5, 0, 730, 260, 40, 40)
Garlic_Draw()
Sleep 30
}
Loop, 25
{
Garlic_Clear()
aa1++
bb1-=2
Garlic_Pie(0xffff9900, 5, 0, 500, 200, 400, 400, aa1, bb1)
Garlic_Ellipse(0xffff9900, 5, 0, 730, 260, 40, 40)
Garlic_Draw()
Sleep 30
}
}
return

Rectangle:
Garlic_Rectangle(0xff000000, 5, 0, 500, 250, 100, 200)
Garlic_Rectangle(0xaa00ff00, 20, 0, 400, 300, 400, 100)
Garlic_Draw()
Sleep 1000
Garlic_RoundedRectangle(0xffff0000, 5, 2,200, 200, 100, 200, 50)
Garlic_RoundedRectangle(0xaa0000ff, 20, 3, 300, 500, 300, 100, 30)
Garlic_Draw()
return

Text:
Options = x500 y200 cff0000ff s20 Italic Center
Garlic_Text("Line 1`nLine 2`n`nLine 3 0123456789", Options, 400, 200)
Options = x300 y300 cffff00ff s25 Bold Underline Right
Garlic_Text("0123456789`n123456`n123`n0", Options, 400, 200)
Options = x300 y300 cffff00ff s25 Bold Underline
Garlic_Text("0123456789`n123456`n123`n0", Options, 400, 200)
Options = x300 y300 cffcc66cc s25 Bold Underline Center
Garlic_Text("0`n123`n123456`n0123456789", Options, 400, 200)
Garlic_Draw()
return

FillEllipse:
Garlic_BrushSolid(0xffff0000)
Garlic_FillEllipse(100, 200, 50, 50)
Garlic_FillEllipse(150, 250, 50, 50)
Garlic_FillEllipse(200, 300, 50, 50)
Garlic_FillEllipse(300, 200, 50, 50)
Garlic_FillEllipse(300, 300, 50, 50)
Garlic_FillEllipse(350, 250, 50, 50)
Garlic_FillEllipse(400, 200, 50, 50)
Garlic_FillEllipse(400, 300, 50, 50)
Garlic_Rectangle(0xffff0000, 5, 80, 180, 190, 200)
Garlic_Rectangle(0xffff0000, 5, 270, 180, 200, 200)
Garlic_BrushHatch(0xff00ff00, 0xff0000ff, 0)
Garlic_FillEllipse(100, 500, 100, 100)
Garlic_BrushHatch(0xffff0000, 0xff0000ff, 36)
Garlic_FillEllipse(200, 500, 100, 100)
Garlic_Draw()
return

FillPie:
Garlic_BrushSolid(0xccff0000)
Garlic_FillPie(500, 200, 200, 200, 0, 90)
Garlic_BrushSolid(0x6600ff00)
Garlic_FillPie(500, 200, 200, 200, 90, 90)
Garlic_BrushHatch(0x990000ff, 0x99ff0000, 20)
Garlic_FillPie(500, 200, 200, 200, 180, 180)
Garlic_Draw()
return

FillPolygon:
Points=300,100|500,100|600,200|400,400|200,200|300,100
Garlic_Lines(0xffff0000, 10, 2, Points)
Garlic_BrushSolid(0xffffff00)
Points=303,105|497,105|595,200|400,395|205,200|303,105
Garlic_FillPolygon(Points)

Garlic_BrushLine(0xffff0000, 0xff00ff00, 400, 200, 500, 200)
Points=503,305|697,305|795,400|600,595|405,400|503,305
Garlic_FillPolygon(Points)
Garlic_Draw()
return

FillRectangle:
Garlic_BrushSolid(0xcc00ff00)
Garlic_FillRectangle(600, 200, 200, 200)
Garlic_BrushHatch(0x99ff0000, 0xff0000ff, 17)
Garlic_FillRoundedRectangle(600, 150, 300, 100, 20)
Garlic_Draw()
return

Esc::
Garlic_Stop()
Exitapp

Syntax:
--Function--
Garlic_Start() --> Run once to start the lib and makes the whole screen as canvas
Garlic_Draw() --> Apply the codes and draw to screen
Garlic_Stop() --> Clean up memory after usage

--Outlined--
Garlic_Arc(ARGB, PenWidth, PenStyle, X, Y, W, H, StartAngle, SweepAngle) --> Creates an arc
Garlic_Bezier(ARGB, PenWidth, PenStyle, X1, Y1, X2, Y2, X3, Y3, W, H) --> Creates a bezier
Garlic_Ellipse(ARGB, PenWidth, PenStyle, X, Y, W, H) --> Creates an ellipse
Garlic_Image(File, sX, sY, sW, sH, dX, dY, dW, dH, Matrix) --> Draw image into your screen
Garlic_ImageSkew(File, Points) --> Draw image into your screen and skew it
Garlic_Line(ARGB, PenWidth, PenStyle, X, Y, W, H) --> Create a line
Garlic_Lines(ARGB, PenWidth, PenStyle, Points) --> Create a series of joined lines
Garlic_Pie(ARGB, PenWidth, PenStyle, X, Y, W, H, StartAngle, SweepAngle) --> Create outlined pie
Garlic_Rectangle(ARGB, PenWidth, PenStyle, X, Y, W, H) --> Create a rectangle
Garlic_RoundedRectangle(ARGB, PenWidth, PenStyle, X, Y, W, H, R) --> Create a rounded rectangle
Garlic_Text(Text, Options, W, H) --> Draw text into your screen

--Filled--
Garlic_FillEllipse(X, Y, W, H) --> Create a filled ellipse
Garlic_FillPie(X, Y, W, H, StartAngle, SweepAngle) --> Create a filled pie *hmm.. yummy*
Garlic_FillPolygon(Points) --> Create a filled polygon
Garlic_FillRectangle(X, Y, W, H) --> Create a filled rectangle
Garlic_FillRoundedRectangle(X, Y, W, H, R) ---> Create a filled rounded rectangle

--Brush--
Garlic_BrushSolid(Brush)
Garlic_BrushHatch(Front, Back, HatchStyle)
Garlic_BrushLine(Front, Back, x, y, w, h)

Notes:
ARGB = Transparency + Red Green Blue in Hex format (ex: 0xFFFF0000).
PenWidth = The width of your pen (that is, the imaginary tool you use to draw on screen).
PenStyle = The style for your pen (0-4).
X, Y, W, H = The coordinate X & Y + Width & Height.
sX, sY, sW, sH = Source coordinate.
dX, dY, dW, dH = Destination coordinate.
StartAngle = The angle to start drawing, 0 = 12 o'clock, 90 = 3 o'clock, 270 = 9 o'clock.
SweepAngle = The amount of angle you want to draw.
File = Specify the file you want to process inside " symbols.
Matrix = This is used to alter the color of your image.
Points = Look at the test script to make it clearer.
R = Radius of rounded edges
Text = Specify the text you want to process inside " symbols.
Options = Works like in "Gui, Add, Text"
Front, Back = Colors to use in the brush
HatchStyle = Hatch style (0-53)

Special thanks to tic for his GDI+ lib! :D

Attached Thumbnails

  • file1.png


tomoe_uehara
  • Members
  • 2166 posts
  • Last active: Jun 11 2015 05:33 PM
  • Joined: 05 Sep 2009
Added a screenshot of Garlic Posted Image
https://dl.dropbox.com/u/32530298/AHK%20Forum/20121104_1440_24.swf

tidbit
  • Administrators
  • 2709 posts
  • Hates playing Janitor
  • Last active: Jan 15 2016 11:37 PM
  • Joined: 09 Mar 2008
that is really awesome! It's how GDI+ should have been Posted Image
A couple minor things:
1) It works in AHK but not AHKL (unicode. probably due to the dllcalls)
2) would it be hard to add a HWND/Parent function (or parameter) to parent the drawn stuff to a window? Then you could add colored regions to windows or lines or animations.

rawr. be very afraid
*poke*
. Populate the AutoHotkey city. Pointless but somewhat fun. .


smorgasboard
  • Members
  • 660 posts
  • Last active: Jan 14 2016 08:53 AM
  • Joined: 18 Jul 2012
tomoe_uehara

great work!!
awesome work!!!
love it!!
thanks.

tomoe_uehara
  • Members
  • 2166 posts
  • Last active: Jun 11 2015 05:33 PM
  • Joined: 05 Sep 2009

[GDI+] Speaker Box
After countless busy hour on real life, I forgot this script and got abandoned for long time, now I have found this unfinished script again and decided to use my free time.
And here it is, another fun script :D

 

This time, you need AHK_L to run it.

tidbit said [03:13] <+tidbit> note: requires ansi, not unicode AHK

Put VA.ahk & Gdip.ahk on your lib folder.
And don't forget to play some music!

 

Post your comment, and forgive me for the silly graphic... :p
(Feel free to rename the extension to .ahk)

 
https://dl.dropboxus...Speaker Box.rar

Right click to make it always on top.


Edited by tomoe_uehara, 16 August 2013 - 08:26 PM.


Wickster
  • Members
  • 97 posts
  • Last active: Jun 03 2019 03:24 AM
  • Joined: 12 Jan 2013

http://puu.sh/41lqp.png

 

 

error when trying the color mixer.



tomoe_uehara
  • Members
  • 2166 posts
  • Last active: Jun 11 2015 05:33 PM
  • Joined: 05 Sep 2009

[GDI+] Stereo Location

Ever wanted to know if there's a sound occurs on your PC even that you don't use a headset/speaker?

Ever wanted to know from what direction does the sound comes from?

Then this script is for you! :D

You need AHK_L, va.ahk, gdip.ahk to make it to work.

Don't forget to rename it to .ahk if you don't use the .ahkl extension..

https://dl.dropboxus...o Location.ahkl

 

@Wickster: You can remove the +altsubmit option, I don't know why it throws an error to me too :p



tidbit
  • Administrators
  • 2709 posts
  • Hates playing Janitor
  • Last active: Jan 15 2016 11:37 PM
  • Joined: 09 Mar 2008

Very nice. cool animations too! Nice use of resource dlls and gdip

 

Note: requires ANSI and you need to put gdip.ahk and VA.ahk in your AHK Lib folder or add #include's into the main script.


rawr. be very afraid
*poke*
. Populate the AutoHotkey city. Pointless but somewhat fun. .