Difference between revisions of "Libgd"

From PLplotWiki
Jump to: navigation, search
(New page: == Description == [http://www.libgd.org gd] is a graphics library. It allows your code to quickly draw images complete with lines, arcs, text, multiple colors, cut and paste from other im...)
(No difference)

Revision as of 11:20, 22 December 2008

Description

gd is a graphics library. It allows your code to quickly draw images complete with lines, arcs, text, multiple colors, cut and paste from other images, and flood fills, and write out the result as a PNG or JPEG file. This is particularly useful in World Wide Web applications, where PNG and JPEG are two of the formats accepted for inline images by most browsers.

Instructions for Mac OS X

N/A

Instructions for Linux

N/A

Instructions for Windows

  • Download gd 2.33 library as zip
  • Unzip gd-latest-win32.zip into a folder of your choice
  • Set the WXWIN environment variable (either system wide or only for your CLI session), e.g.
set WXWIN=C:\wxWidgets-2.8.9
  • The following instructions will build a shared, unicode, release version of wxWidgets. If you use plplot within your wxWidgets application you have already a wxWidgets library ready for use - see cmake-path\share\modules\FindwxWidgets.cmake for the options for your special wxWidgets library.

MinGW command line tools

  • To compile wxWidgets with the MinGW compiler run
cd %WXWIN%\build\msw
mingw32-make -f makefile.gcc SHARED=1 UNICODE=1 BUILD=release
  • set environment variables
set PATH=%WXWIN%\lib\gcc_dll;%PATH%

CMake is now able to find the wxWidgets library and headers, if you additionally set the following cmake options for MinGW:

 -DwxWidgets_LIB_DIR=%WXWIN%/lib/gcc_dll -DwxWidgets_CONFIGURATION=mswu -DENABLE_MIX_CXX=ON

VisualC command line tools

  • To compile wxWidgets with the Visual C++ command line toolset run
cd %WXWIN%\build\msw
nmake -f makefile.vc SHARED=1 UNICODE=1 BUILD=release USE_GDIPLUS=1

This builds a shared, unicode release library of wxWidgets with GDI+ support for wxGraphicsContext included.

  • Open the file %WXWIN%\lib\vc_dll\mswu\wx\setup.h and change
#define wxUSE_GRAPHICS_CONTEXT 0

to

#define wxUSE_GRAPHICS_CONTEXT 1
  • set environment variables (Visual C++)
set PATH=%WXWIN%\lib\vc_dll;%PATH%
  • CMake is now able to find the wxWidgets library and headers, if you additionally set the following cmake options for Visual C++:
 -DwxWidgets_LIB_DIR=%WXWIN%/lib/vc_dll -DwxWidgets_CONFIGURATION=mswu -DENABLE_MIX_CXX=ON