Skip to content
C-based implementation of the GDI+ API
Branch: master
Clone or download
Latest commit dba6fc6 Mar 15, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.vscode Rename BitmapData->ActiveBitmapData (#444) Oct 16, 2018
docs Some minimal documentation about using valgrind to debug libgdiplus a… Mar 23, 2006
src bmpcodec.c: Add out-of-bounds checks to memset of scan0 in gdip_read_… Mar 15, 2019
tests bmpcodec.c: Reject top-bottom images in gdip_read_bmp_rle_4bit() and … Mar 15, 2019
.gitattributes Override *.inc language classification (#267) Mar 31, 2018
.gitignore
.jenkins-linux.sh
.jenkins-osx.sh
.jenkins-windows.ps1
.travis.yml
AUTHORS
COPYING Add back COPYING file Sep 20, 2017
ChangeLog
INSTALL - Merged cairo 1.0 branch of GDI+ Aug 29, 2005
LICENSE Update LICENSE to match the headers of the source files Jul 17, 2018
Makefile.am
NEWS
README.md Add instructions for code coverage Sep 18, 2018
TODO Move some items from website into TODO Sep 21, 2017
autogen.sh
configure.ac Set version to 5.8 Feb 4, 2019
libgdiplus.pc.in
libgdiplus.sln
libgdiplus0.spec.in Fix shell syntax error in configure.ac (#517) Nov 26, 2018
winconfig.h.in

README.md

libgdiplus: An Open Source implementation of the GDI+ API.

This is part of the Mono project.

Build status:

Travis (Linux/OSX) Travis Build Status
Jenkins (Linux) Jenkins Linux Build Status
Jenkins (Windows) Jenkins Windows Build Status

Requirements:

This requires the libraries used by the Cairo vector graphics library to build (freetype2, fontconfig, Xft2 and libpng).

On OSX you can use Homebrew to install the dependencies:

brew install glib cairo libexif libjpeg giflib libtiff autoconf libtool automake pango pkg-config
brew link gettext --force

On Debian-based Linux distributions you can use apt-get to install the dependencies:

sudo apt-get install libgif-dev autoconf libtool automake build-essential gettext libglib2.0-dev libcairo2-dev libtiff-dev libexif-dev

On Windows you can use Vcpkg to install the dependencies. Run the following commands from the root of the repository from an admin command prompt:

bootstrap-vcpkg.bat
vcpkg.exe integrate install
vcpkg.exe install giflib libjpeg-turbo libpng cairo glib tiff libexif glib pango --triplet x86-windows
vcpkg.exe install giflib libjpeg-turbo libpng cairo glib tiff libexif glib pango --triplet x64-windows

Build instructions

To build on OSX without X11:

./autogen.sh --without-x11 --prefix=YOUR_PREFIX
make

To build on OSX with X11 (e.g. from XQuartz):

PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig ./autogen.sh --prefix=YOUR_PREFIX
make

To build on Linux:

./autogen.sh --prefix=YOUR_PREFIX
make

To build on Windows, open libgdiplus.sln.

Running the unit tests

Run the following command from the root of the repository:

make check

To run the tests with Clang sanitizers, run the following command from the root of the repository:

./autogen.sh --enable-asan
make check

Code coverage

Code coverage stats are generated with lcov. You can use Homebrew on OSX to install the dependencies:

brew install lcov

To run the tests with code coverage, run the following commands from the root of the repository:

./autogen.sh --enable-coverage
make check
lcov --capture --directory src --output-file coverage.info
genhtml coverage.info --output-directory coverage

To view the coverage report, navigate to the coverage directory in the root of the repository and open index.html.

Installing libgdiplus

Run the following command from the root of the repository:

make install

Optional build options

--with-pango

This builds libgdiplus using Pango to render (measure and draw) 
all of it's text. This requires Pango version 1.38 (or later).
You can’t perform that action at this time.