Skip to content

bceenaeiklmr/GpGFX

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GpGFX

GpGFX is a graphics library for AutoHotkey v2, providing drawing and rendering capabilities using Gdiplus (also known as GDI+). It includes classes for creating and manipulating shapes, colors, fonts, layers, and more. For more information on GDI+, visit the Microsoft documentation. This is still an early version of the library, so expect some bugs and changes.

Features

CS50AI - Depth First Search (DFS), Breadth First Search (BFS) - visualization with AHK and GDI+

General

  • Provides an intuitive, easy-to-use API to draw graphics objects onto the screen.
  • Provides debugging information about resource management.
  • Manages freeing up used resources automatically.

Installation

  1. Ensure you have the latest version of AutoHotkey v2 installed.
  2. Clone or download this repository.
  3. Visit the example folder and run the files.
  4. There is a standalone file; you can rename it to GpGFX.ahk and use it. (optional)

Example

Visit the example folder where you can find multiple files with comments.

Layer

A layer is a container for drawing operations. It holds shapes, text, and images that can be drawn onto the layer.

It is a transparent window and a GUI in AutoHotkey.

; A layer will be the size of the main display if no parameters are specified
lyr := Layer()

; Create a square with a size of 100 pixels, centered automatically by omitting the x and y parameters.
; The color will be either red or yellow.
sq := Square(, , 100, "Red|Yellow")
sq.str := "Hello, World!"

; Display the shape for a second
Draw(lyr)
Sleep(1000)

; Destroy the window and exit the script
End()

Shapes

Available base shapes:

Rectangle, Square, Ellipse, Pie, Polygon, Triangle, Point, Line, Lines, Arc, Bezier, Beziers

Fillable shapes:

Rectangle, Square, Ellipse, Pie, Polygon, Triangle

Available properties:

Add text. The string will be auto-centered within the shape by default.

rect.str := "Hello, " A_UserName

Add an image:

resize := 50 ; %
rect.AddImage(imgPath, resize, "Sepia")

Change color:

; Using common formats
rect.Color := "#00FF00"

; Random color
rect.Color := ""

; Random color from a list of colors
rect.Color := "red|green|blue"

; Change to Linear Gradient Mode
rect.Color := ["red", "orange"]

; ... see the examples

Change fill and alpha properties to modify the shape, and so on.

Credits

I want to thank everyone who contributes to the AHK community.

About

GDI+ graphics library for AutoHotkey v2 to create beautiful 2D graphics or render animations.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published