Suporte a arquivos SVG.
O que há de mais moderno na opção de imagens.
As imagens são arquivos XML, extremamente pequenos e de alta resolução. Qualquer tamanho. 16, 256, etc...
Na Microsoft Windows 10/11 usa, no Linux é o padrão.
Código: Selecionar todos
2026-09-13 18:13 UTC-0300 Junior Itamar <itamarlins@gmail.com>
* Language changed samples\test_svg.prg pt-br for en
command for test SVG image files:
hbmk2 test_svg.prg ..\svg.hbc
2026-09-13 18:02 UTC-0300 Junior Itamar <itamarlins@gmail.com>
* Add optional SVG image loading via librsvg (Cairo + GLib + GObject).
Enable with -D__USE_LIBRSVG and link against rsvg-2, cairo,
gobject-2.0 and glib-2.0.
New function:
hwg_LoadSvg( cPath, nWidth, nHeight ) -> HBITMAP
The DIB is filled with white before rendering so that transparent
areas of the SVG appear as white instead of black (hwg_Drawbitmap
ignores the alpha channel).
When __USE_LIBRSVG is not defined, HWG_LOADSVG() is compiled as a
stub that returns NULL, so callers do not need to guard the call
with #ifdef.
* hwgui.hbp add commented line #-cflag=-D__USE_LIBRSVG
* Add HBitmap:AddHandle( hBmp ) to wrap an HBITMAP created outside
the class (e.g. by hwg_LoadSvg). The handle is registered in the
shared bitmap list, so HBitmap:RELEASE() deletes it when the object
is released.
* source\winapi\draw.c add function HWG_LOADSVG()
* source\winapi\drawwidg.prg add method AddHandle()
+ Add svg.hbc for use of optional SVG recurse. hbmk2 hwgui.hbp svg.hbc
+ Add files hwgui.svg and info.svg
+ Add sample test_svg.prg
! Attention with file hwgui.hbp
# Uncomment these line to build HwGUI with LIBRSVG SVG files
#-cflag=-D__USE_LIBRSVG
command: hbmk2 hwgui.hbp svg.hbc
Note: Use msys2 on Windows OS Clang.
* pacman -S mingw-w64-clang-x86_64-librsvg
* pacman -S mingw-w64-clang-x86_64-gdk-pixbuf2
This resource uses several libraries: 4 main libs + their
transitive dependencies. To find all the libraries needed for
distributing your app:
C:\msys64\clang64\bin\llvm-objdump.exe -p test_svg.exe | C:\msys64\usr\bin\grep.exe -i "DLL Name"
cd C:\msys64\clang64\bin
C:\msys64\clang64\bin\llvm-objdump.exe -p librsvg-2-2.dll | C:\msys64\usr\bin\grep.exe -i "DLL Name"
C:\msys64\clang64\bin\llvm-objdump.exe -p libcairo-2.dll | C:\msys64\usr\bin\grep.exe -i "DLL Name"
C:\msys64\clang64\bin\llvm-objdump.exe -p libgobject-2.0-0.dll | C:\msys64\usr\bin\grep.exe -i "DLL Name"
C:\msys64\clang64\bin\llvm-objdump.exe -p libglib-2.0-0.dll | C:\msys64\usr\bin\grep.exe -i "DLL Name"
O arquivo SVG! Isso é uma IMAGEM ou pelo menos como ele deve ser redenrizada.
Código: Selecionar todos
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 286 154" width="100%" height="100%">
<!-- General White Background -->
<rect width="286" height="154" fill="#FFFFFF" />
<!-- Dark Brown Shape on the Left -->
<path d="M 0,0 L 82,0 L 37,74 L 71,154 L 0,154 Z" fill="#6A3B03" />
<!-- Orange/Triangular Bottom Shape -->
<path d="M 37,74 L 286,74 L 71,154 Z" fill="#FF843D" />
<!-- Main Text Block -->
<g font-family="Arial, Helvetica, sans-serif" fill="#000000">
<text x="76" y="34" font-size="25" font-weight="normal">HwGUI</text>
<text x="76" y="62" font-size="21" font-weight="normal">Harbour Win32 Gui</text>
<text x="167" y="143" font-size="12" font-weight="normal">By Alexander Kresin</text>
</g>
</svg>

