Unit avoraiser.gdi

Description

Avoraiser UI Framework - High-Performance WinAPI UI for Avocado Avoraiser is a framework for creating modern user interfaces for the Polish programming language Avocado. Copyright (c) 2025-2026 Dymitr Wygowski (Programista Art) Project Created: 23.12.2025

Author: Dymitr Wygowski (Programista Art) Contact: programista.art@gmail.com GitHub: https://github.com/Programista-Art/Avoraiser Version: 1.0 License: Dual-Licensed: Avoraiser Community / Commercial See LICENSE.md for terms and conditions.

Module: avoraiser.gdi Description:

Uses

Overview

Classes, Interfaces, Objects and Records

Name Description
Record GpRect  
Record TDoubleBufferState Struktura przechowująca stan wirtualnego bufora
Record TGdiplusStartupInput  

Functions and Procedures

function begin_double_buffer(TargetDC: HDC; const R: TRect): TDoubleBufferState;
function copy_pixels(DestDC: HDC; DestX, DestY, W, H: Integer; SrcDC: HDC; SrcX, SrcY: Integer): Boolean;
function create_circle_filled(Parent: HWND; X, Y, Diameter: Integer; Color: DWORD): HWND;
function create_circle_image(Parent: HWND; FilePath: UnicodeString; X, Y, Size: Integer): HWND;
function create_circle_outline(Parent: HWND; X, Y, Diameter: Integer; Color: DWORD; Thickness: Integer = 1): HWND;
function create_frame(Parent: HWND; X, Y, W, H: Integer; Color: DWORD; Thickness: Integer = 1): HWND;
function create_gradient_panel(Parent: HWND; X, Y, W, H: Integer; ColorStart, ColorEnd: DWORD; Direction: Integer = 1): HWND;
function create_image_box(Parent: HWND; FilePath: UnicodeString; X, Y, W, H: Integer): HWND;
function create_line(Parent: HWND; X1, Y1, X2, Y2: Integer; Color: DWORD; Thickness: Integer = 1): HWND;
function create_polygon_box(Parent: HWND; X, Y, W, H: Integer; const Points: array of TPoint; FillColor: DWORD): HWND;
function create_polyline_box(Parent: HWND; X, Y, W, H: Integer; const Points: array of TPoint; Color: DWORD; Thickness: Integer): HWND;
function create_rotated_image(Parent: HWND; FilePath: UnicodeString; X, Y, W, H: Integer; InitialAngle: Integer = 0): HWND;
function create_rounded_panel(Parent: HWND; X, Y, W, H: Integer; Color: DWORD; Radius: Integer): HWND;
function delete_object(hObject: HWND): Boolean;
procedure draw_fill_rectangle(Window: HWND; X, Y, W, H: Integer; Color: DWORD; TargetDC: HDC = 0);
procedure draw_image(h_dc: HDC; x, y, width, height: Integer; const image_path: UnicodeString);
procedure draw_line(Window: HWND; X1, Y1, X2, Y2: Integer; Color: DWORD; TargetDC: HDC = 0);
procedure draw_polyline(Window: HWND; const Points: array of TPoint; Color: DWORD; Thickness: Integer; TargetDC: HDC);
procedure draw_rectangle(Window: HWND; X, Y, W, H: Integer; Color: DWORD; TargetDC: HDC = 0);
procedure draw_smooth_rounded_rect(Graphics: Pointer; Rect: TRect; Radius: Integer; Color: DWORD);
procedure draw_text_advanced(DC: HDC; var R: TRect; Text: UnicodeString; Flags: Cardinal = DT_LEFT or DT_TOP or DT_SINGLELINE);
procedure draw_text_custom(DC: HDC; X, Y: Integer; Text: UnicodeString; Color: DWORD; TransparentBk: Boolean = True);
procedure draw_text_simple(DC: HDC; X, Y: Integer; Text: UnicodeString);
procedure end_double_buffer(var State: TDoubleBufferState);
procedure fill_pattern(DC: HDC; X, Y, W, H: Integer; Rop: DWORD = PATCOPY);
function GdipAddPathArc(Path: Pointer; X, Y, Width, Height, StartAngle, SweepAngle: Single): Integer; stdcall; external 'gdiplus.dll';
function GdipAddPathArcI(path: GpPath; x, y, width, height: Integer; startAngle, sweepAngle: Single): GpStatus; stdcall; external 'gdiplus.dll';
function GdipAddPathEllipseI(Path: Pointer; X, Y, Width, Height: Integer): Integer; stdcall; external 'gdiplus.dll';
function GdipAddPathRectangleI(Path: Pointer; X, Y, Width, Height: Integer): Integer; stdcall; external 'gdiplus.dll';
function GdipClosePathFigure(path: GpPath): GpStatus; stdcall; external 'gdiplus.dll';
function GdipCreateFromHDC(hdc: HDC; out graphics: Pointer): Integer; stdcall; external 'gdiplus.dll';
function GdipCreateLineBrushFromRectI(rect: PGpRect; color1, color2: DWORD; mode: Integer; wrapMode: Integer; out brush: GpBrush): GpStatus; stdcall; external 'gdiplus.dll';
function GdipCreatePath(brushMode: FillMode; out path: GpPath): GpStatus; stdcall; external 'gdiplus.dll';
function GdipCreatePen1(color: DWORD; width: Single; unit_: Integer; out pen: GpPen): GpStatus; stdcall; external 'gdiplus.dll';
function GdipCreateSolidFill(color: DWORD; out brush: GpBrush): GpStatus; stdcall; external 'gdiplus.dll';
function GdipCreateTexture(Image: Pointer; WrapMode: Integer; out Brush: Pointer): Integer; stdcall; external 'gdiplus.dll';
function GdipDeleteBrush(brush: GpBrush): GpStatus; stdcall; external 'gdiplus.dll';
function GdipDeleteGraphics(graphics: Pointer): Integer; stdcall; external 'gdiplus.dll';
function GdipDeletePath(path: GpPath): GpStatus; stdcall; external 'gdiplus.dll';
function GdipDeletePen(pen: GpPen): GpStatus; stdcall; external 'gdiplus.dll';
function GdipDisposeImage(image: GpImage): GpStatus; stdcall; external 'gdiplus.dll';
function GdipDrawEllipseI(graphics: GpGraphics; pen: GpPen; x, y, width, height: Integer): GpStatus; stdcall; external 'gdiplus.dll';
function GdipDrawImageRectI(graphics: GpGraphics; image: GpImage; x, y, width, height: Integer): GpStatus; stdcall; external 'gdiplus.dll';
function GdipDrawLineI(graphics: GpGraphics; pen: GpPen; x1, y1, x2, y2: Integer): GpStatus; stdcall; external 'gdiplus.dll';
function GdipDrawLinesI(graphics: GpGraphics; pen: GpPen; points: PPoint; count: Integer): GpStatus; stdcall; external 'gdiplus.dll';
function GdipDrawPath(graphics: GpGraphics; pen: GpPen; path: GpPath): GpStatus; stdcall; external 'gdiplus.dll';
function GdipDrawPolygonI(graphics: GpGraphics; pen: GpPen; points: Pointer; count: Integer): GpStatus; stdcall; external 'gdiplus.dll';
function GdipFillEllipseI(graphics: GpGraphics; brush: GpBrush; x, y, width, height: Integer): GpStatus; stdcall; external 'gdiplus.dll';
function GdipFillPath(graphics: GpGraphics; brush: GpBrush; path: GpPath): GpStatus; stdcall; external 'gdiplus.dll';
function GdipFillPolygonI(graphics: GpGraphics; brush: GpBrush; points: Pointer; count: Integer; fillMode: Integer): GpStatus; stdcall; external 'gdiplus.dll';
function GdipFillRectangleI(graphics: GpGraphics; brush: GpBrush; x, y, width, height: Integer): GpStatus; stdcall; external 'gdiplus.dll';
function GdipGetImageHeight(image: GpImage; out height: Cardinal): GpStatus; stdcall; external 'gdiplus.dll';
function GdipGetImageWidth(image: GpImage; out width: Cardinal): GpStatus; stdcall; external 'gdiplus.dll';
function GdipLoadImageFromFile(filename: PWideChar; out image: GpImage): GpStatus; stdcall; external 'gdiplus.dll';
procedure GdiplusShutdown(token: ULONG_PTR); stdcall; external 'gdiplus.dll';
function GdiplusStartup(out Token: ULONG_PTR; Input: Pointer; Output: Pointer): GPStatus; stdcall; external 'gdiplus.dll';
function GdiplusStartup(out token: ULONG_PTR; const input: TGdiplusStartupInput; output: Pointer): Integer; stdcall; external 'gdiplus.dll';
procedure gdiplus_shutdown;
function GdipResetClip(Graphics: Pointer): Integer; stdcall; external 'gdiplus.dll';
function GdipResetPath(path: GpPath): GpStatus; stdcall; external 'gdiplus.dll';
function GdipRotateWorldTransform(graphics: GpGraphics; angle: Single; order: Integer): GpStatus; stdcall; external 'gdiplus.dll';
function GdipSetClipPath(graphics: GpGraphics; path: GpPath; mode: Integer): GpStatus; stdcall; external 'gdiplus.dll';
function GdipSetPixelOffsetMode(Graphics: Pointer; Mode: Integer): GPStatus; stdcall; external 'gdiplus.dll';
function GdipSetSmoothingMode(Graphics: Pointer; Mode: Integer): GPStatus; stdcall; external 'gdiplus.dll';
function GdipTranslateWorldTransform(graphics: GpGraphics; dx, dy: Single; order: Integer): GpStatus; stdcall; external 'gdiplus.dll';
function get_image_size(const file_path: UnicodeString; out width, height: Integer): Boolean;
function get_pixel(DC: HDC; X, Y: Integer): DWORD;
procedure get_text_size(DC: HDC; const Text: UnicodeString; out Width, Height: Integer);
function load_button_icon(const filename: UnicodeString): HBITMAP;
function point(X, Y: Integer): TPoint; inline;
procedure set_bk_mode(DC: HDC; IsTransparent: Boolean);
procedure set_image_angle(hImg: HWND; Angle: Integer);
procedure set_pixel(DC: HDC; X, Y: Integer; Color: DWORD);
procedure set_text_color(DC: HDC; Color: DWORD);
function stretch_pixels(DestDC: HDC; DestX, DestY, DestW, DestH: Integer; SrcDC: HDC; SrcX, SrcY, SrcW, SrcH: Integer): Boolean;

Types

FillMode = Integer;
GpBrush = Pointer;
GpGraphics = Pointer;
GpImage = Pointer;
GpPath = Pointer;
GpPen = Pointer;
GpStatus = Integer;
PGpRect = ˆGpRect;

Description

Functions and Procedures

function begin_double_buffer(TargetDC: HDC; const R: TRect): TDoubleBufferState;

Rozpoczyna rysowanie w pamięci RAM (poza ekranem)

function copy_pixels(DestDC: HDC; DestX, DestY, W, H: Integer; SrcDC: HDC; SrcX, SrcY: Integer): Boolean;

Szybkie kopiowanie bloku pikseli 1:1 (odpowiednik BitBlt)

function create_circle_filled(Parent: HWND; X, Y, Diameter: Integer; Color: DWORD): HWND;

Tworzy pełne, kolorowe koło

function create_circle_image(Parent: HWND; FilePath: UnicodeString; X, Y, Size: Integer): HWND;

Obrazek w kolo

function create_circle_outline(Parent: HWND; X, Y, Diameter: Integer; Color: DWORD; Thickness: Integer = 1): HWND;

Tworzy sam obrys koła (puste w środku)

function create_frame(Parent: HWND; X, Y, W, H: Integer; Color: DWORD; Thickness: Integer = 1): HWND;

Tworzy trwałą ramkę (pusta w środku)

function create_gradient_panel(Parent: HWND; X, Y, W, H: Integer; ColorStart, ColorEnd: DWORD; Direction: Integer = 1): HWND;

Tworzy gradient

function create_image_box(Parent: HWND; FilePath: UnicodeString; X, Y, W, H: Integer): HWND;

Obrazki

function create_line(Parent: HWND; X1, Y1, X2, Y2: Integer; Color: DWORD; Thickness: Integer = 1): HWND;

Rysowanie Linii nie znika

function create_polygon_box(Parent: HWND; X, Y, W, H: Integer; const Points: array of TPoint; FillColor: DWORD): HWND;

Tworzy obiekt zamkniętego wielokąta (np. trójkąta) wypełnionego kolorem

function create_polyline_box(Parent: HWND; X, Y, W, H: Integer; const Points: array of TPoint; Color: DWORD; Thickness: Integer): HWND;

This item has no description.

function create_rotated_image(Parent: HWND; FilePath: UnicodeString; X, Y, W, H: Integer; InitialAngle: Integer = 0): HWND;

This item has no description.

function create_rounded_panel(Parent: HWND; X, Y, W, H: Integer; Color: DWORD; Radius: Integer): HWND;

This item has no description.

function delete_object(hObject: HWND): Boolean;

Usuwa dowolny obiekt graficzny (kółko, linię, obrazek, panel) i zwalnia pamięć

procedure draw_fill_rectangle(Window: HWND; X, Y, W, H: Integer; Color: DWORD; TargetDC: HDC = 0);

Rysuje wypełniony prostokąt (bez obrysu lub z obrysem w tym samym kolorze)

procedure draw_image(h_dc: HDC; x, y, width, height: Integer; const image_path: UnicodeString);

This item has no description.

procedure draw_line(Window: HWND; X1, Y1, X2, Y2: Integer; Color: DWORD; TargetDC: HDC = 0);

Rysowanie linii znika

procedure draw_polyline(Window: HWND; const Points: array of TPoint; Color: DWORD; Thickness: Integer; TargetDC: HDC);

This item has no description.

procedure draw_rectangle(Window: HWND; X, Y, W, H: Integer; Color: DWORD; TargetDC: HDC = 0);

Rysuje sam obrys prostokąta (pusty w środku)

procedure draw_smooth_rounded_rect(Graphics: Pointer; Rect: TRect; Radius: Integer; Color: DWORD);

This item has no description.

procedure draw_text_advanced(DC: HDC; var R: TRect; Text: UnicodeString; Flags: Cardinal = DT_LEFT or DT_TOP or DT_SINGLELINE);

Zaawansowane rysowanie w prostokącie (odpowiednik DrawText) Obsługuje zawijanie wierszy, wyrównanie do prawej/środka i ucinanie z "..."

procedure draw_text_custom(DC: HDC; X, Y: Integer; Text: UnicodeString; Color: DWORD; TransparentBk: Boolean = True);

This item has no description.

procedure draw_text_simple(DC: HDC; X, Y: Integer; Text: UnicodeString);

rysowanie tekstu Szybkie rysowanie tekstu w jednym rzędzie (odpowiednik TextOut)

procedure end_double_buffer(var State: TDoubleBufferState);

Kończy rysowanie, przerzuca obraz na ekran i sprząta pamięć

procedure fill_pattern(DC: HDC; X, Y, W, H: Integer; Rop: DWORD = PATCOPY);

Szybkie wypełnianie z użyciem operacji bitowych (odpowiednik PatBlt) Rop = Raster Operation (np. PATCOPY, DSTINVERT)

function GdipAddPathArc(Path: Pointer; X, Y, Width, Height, StartAngle, SweepAngle: Single): Integer; stdcall; external 'gdiplus.dll';

This item has no description.

function GdipAddPathArcI(path: GpPath; x, y, width, height: Integer; startAngle, sweepAngle: Single): GpStatus; stdcall; external 'gdiplus.dll';

This item has no description.

function GdipAddPathEllipseI(Path: Pointer; X, Y, Width, Height: Integer): Integer; stdcall; external 'gdiplus.dll';

This item has no description.

function GdipAddPathRectangleI(Path: Pointer; X, Y, Width, Height: Integer): Integer; stdcall; external 'gdiplus.dll';

This item has no description.

function GdipClosePathFigure(path: GpPath): GpStatus; stdcall; external 'gdiplus.dll';

This item has no description.

function GdipCreateFromHDC(hdc: HDC; out graphics: Pointer): Integer; stdcall; external 'gdiplus.dll';

This item has no description.

function GdipCreateLineBrushFromRectI(rect: PGpRect; color1, color2: DWORD; mode: Integer; wrapMode: Integer; out brush: GpBrush): GpStatus; stdcall; external 'gdiplus.dll';

Import funkcji tworzącej pędzel gradientowy

function GdipCreatePath(brushMode: FillMode; out path: GpPath): GpStatus; stdcall; external 'gdiplus.dll';

This item has no description.

function GdipCreatePen1(color: DWORD; width: Single; unit_: Integer; out pen: GpPen): GpStatus; stdcall; external 'gdiplus.dll';

This item has no description.

function GdipCreateSolidFill(color: DWORD; out brush: GpBrush): GpStatus; stdcall; external 'gdiplus.dll';

Pędzle i Pióra

function GdipCreateTexture(Image: Pointer; WrapMode: Integer; out Brush: Pointer): Integer; stdcall; external 'gdiplus.dll';

This item has no description.

function GdipDeleteBrush(brush: GpBrush): GpStatus; stdcall; external 'gdiplus.dll';

This item has no description.

function GdipDeleteGraphics(graphics: Pointer): Integer; stdcall; external 'gdiplus.dll';

This item has no description.

function GdipDeletePath(path: GpPath): GpStatus; stdcall; external 'gdiplus.dll';

This item has no description.

function GdipDeletePen(pen: GpPen): GpStatus; stdcall; external 'gdiplus.dll';

This item has no description.

function GdipDisposeImage(image: GpImage): GpStatus; stdcall; external 'gdiplus.dll';

This item has no description.

function GdipDrawEllipseI(graphics: GpGraphics; pen: GpPen; x, y, width, height: Integer): GpStatus; stdcall; external 'gdiplus.dll';

This item has no description.

function GdipDrawImageRectI(graphics: GpGraphics; image: GpImage; x, y, width, height: Integer): GpStatus; stdcall; external 'gdiplus.dll';

This item has no description.

function GdipDrawLineI(graphics: GpGraphics; pen: GpPen; x1, y1, x2, y2: Integer): GpStatus; stdcall; external 'gdiplus.dll';

This item has no description.

function GdipDrawLinesI(graphics: GpGraphics; pen: GpPen; points: PPoint; count: Integer): GpStatus; stdcall; external 'gdiplus.dll';

Import do rysowania wielu połączonych linii na raz

function GdipDrawPath(graphics: GpGraphics; pen: GpPen; path: GpPath): GpStatus; stdcall; external 'gdiplus.dll';

function GdipSetPixelOffsetMode(Graphics: Pointer; Mode: Integer): GPStatus; stdcall; external 'gdiplus.dll'; Opcjonalnie do ramki:

function GdipDrawPolygonI(graphics: GpGraphics; pen: GpPen; points: Pointer; count: Integer): GpStatus; stdcall; external 'gdiplus.dll';

This item has no description.

function GdipFillEllipseI(graphics: GpGraphics; brush: GpBrush; x, y, width, height: Integer): GpStatus; stdcall; external 'gdiplus.dll';

Rysowanie

function GdipFillPath(graphics: GpGraphics; brush: GpBrush; path: GpPath): GpStatus; stdcall; external 'gdiplus.dll';

This item has no description.

function GdipFillPolygonI(graphics: GpGraphics; brush: GpBrush; points: Pointer; count: Integer; fillMode: Integer): GpStatus; stdcall; external 'gdiplus.dll';

This item has no description.

function GdipFillRectangleI(graphics: GpGraphics; brush: GpBrush; x, y, width, height: Integer): GpStatus; stdcall; external 'gdiplus.dll';

Import funkcji wypełniającej prostokąt

function GdipGetImageHeight(image: GpImage; out height: Cardinal): GpStatus; stdcall; external 'gdiplus.dll';

This item has no description.

function GdipGetImageWidth(image: GpImage; out width: Cardinal): GpStatus; stdcall; external 'gdiplus.dll';

This item has no description.

function GdipLoadImageFromFile(filename: PWideChar; out image: GpImage): GpStatus; stdcall; external 'gdiplus.dll';

Ładowanie i usuwanie obrazków

procedure GdiplusShutdown(token: ULONG_PTR); stdcall; external 'gdiplus.dll';

This item has no description.

function GdiplusStartup(out Token: ULONG_PTR; Input: Pointer; Output: Pointer): GPStatus; stdcall; external 'gdiplus.dll';

Importujemy funkcje bezpośrednio z DLL, żeby nie wymagać zewnętrznych modułów

function GdiplusStartup(out token: ULONG_PTR; const input: TGdiplusStartupInput; output: Pointer): Integer; stdcall; external 'gdiplus.dll';

This item has no description.

procedure gdiplus_shutdown;

function gdiplus_init: Boolean;

function GdipResetClip(Graphics: Pointer): Integer; stdcall; external 'gdiplus.dll';

This item has no description.

function GdipResetPath(path: GpPath): GpStatus; stdcall; external 'gdiplus.dll';

This item has no description.

function GdipRotateWorldTransform(graphics: GpGraphics; angle: Single; order: Integer): GpStatus; stdcall; external 'gdiplus.dll';

Do transformacji Obracanie

function GdipSetClipPath(graphics: GpGraphics; path: GpPath; mode: Integer): GpStatus; stdcall; external 'gdiplus.dll';

Do przycinania Avatary

function GdipSetPixelOffsetMode(Graphics: Pointer; Mode: Integer): GPStatus; stdcall; external 'gdiplus.dll';

This item has no description.

function GdipSetSmoothingMode(Graphics: Pointer; Mode: Integer): GPStatus; stdcall; external 'gdiplus.dll';

function GdiplusStartup(out token: PtrUInt; input: Pointer; output: Pointer): GpStatus; stdcall; external 'gdiplus.dll'; function GdipSetSmoothingMode(graphics: GpGraphics; mode: Integer): GpStatus; stdcall; external 'gdiplus.dll'; nowe

function GdipTranslateWorldTransform(graphics: GpGraphics; dx, dy: Single; order: Integer): GpStatus; stdcall; external 'gdiplus.dll';

This item has no description.

function get_image_size(const file_path: UnicodeString; out width, height: Integer): Boolean;

Pobiera rozmiar obrazka

function get_pixel(DC: HDC; X, Y: Integer): DWORD;

Pobiera kolor piksela z podanych współrzędnych (zwraca wartość DWORD / COLORREF)

procedure get_text_size(DC: HDC; const Text: UnicodeString; out Width, Height: Integer);

Oblicza szerokość i wysokość tekstu w pikselach dla aktualnej czcionki na DC

function load_button_icon(const filename: UnicodeString): HBITMAP;

This item has no description.

function point(X, Y: Integer): TPoint; inline;

Tworzy strukturę TPoint w locie (zastępuje funkcję z modułu Classes)

procedure set_bk_mode(DC: HDC; IsTransparent: Boolean);

Ustawia tryb tła pod tekstem (True = przezroczyste, False = zamalowane kolorem tła)

procedure set_image_angle(hImg: HWND; Angle: Integer);

Zmiana kąta w locie (np. animacja)

procedure set_pixel(DC: HDC; X, Y: Integer; Color: DWORD);

Rysuje pojedynczy punkt na podanych współrzędnych

procedure set_text_color(DC: HDC; Color: DWORD);

Zmienia kolor rysowanego tekstu na danym DC

function stretch_pixels(DestDC: HDC; DestX, DestY, DestW, DestH: Integer; SrcDC: HDC; SrcX, SrcY, SrcW, SrcH: Integer): Boolean;

Kopiowanie ze skalowaniem (odpowiednik StretchBlt)

Types

FillMode = Integer;

This item has no description.

GpBrush = Pointer;

This item has no description.

GpGraphics = Pointer;

This item has no description.

GpImage = Pointer;

This item has no description.

GpPath = Pointer;

This item has no description.

GpPen = Pointer;

This item has no description.

GpStatus = Integer;

This item has no description.

PGpRect = ˆGpRect;

This item has no description.


Generated by PasDoc 1.0.4.