Sign in Join
Wiki copytemporary

libgd: what changed

Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
11The **gd** unit is the interface unit for the gd library. The gd library is a library to produce graphics files (jpeg,png and wbmp), available from this site.
22
33It was converted from the header files for version 1.8.4., but other versions may work as well.
44
55It has some additional calls which make it more pascal like:
66
7-`function fopen(a,b:string):pFile;`\
8-`procedure gdImageChar(im:gdImagePtr; f:gdFontPtr; x:longint; y:longint; c:char; color:longint);`\
9-`procedure gdImageCharUp(im:gdImagePtr; f:gdFontPtr; x:longint; y:longint; c:char; color:longint);`\
10-`procedure gdImageString(im:gdImagePtr; f:gdFontPtr; x:longint; y:longint; s:string;  color:longint);`\
11-`procedure gdImageStringUp(im:gdImagePtr; f:gdFontPtr; x:longint; y:longint; s:string; color:longint);`\
12-`procedure gdImageString16(im:gdImagePtr; f:gdFontPtr; x:longint; y:longint; s:string; color:longint);`\
13-`procedure gdImageStringUp16(im:gdImagePtr; f:gdFontPtr; x:longint; y:longint; s:string; color:longint);`\
14-`{$ifdef hasttf}`\
15-`function  gdImageStringTTF(im:PgdImage; brect:Plongint; fg:longint; fontlist:string; ptsize:double; angle:double; x:longint; y:longint; astring:string): string;`\
16-`function  gdImageStringFT(im:PgdImage; brect:Plongint; fg:longint; fontlist:string; ptsize:double; angle:double; x:longint; y:longint; astring:string):string;`\
17-`{$endif}`
7+``` pascal
8+function fopen(a,b:string):pFile;
9+procedure gdImageChar(im:gdImagePtr; f:gdFontPtr; x:longint; y:longint; c:char; color:longint);
10+procedure gdImageCharUp(im:gdImagePtr; f:gdFontPtr; x:longint; y:longint; c:char; color:longint);
11+procedure gdImageString(im:gdImagePtr; f:gdFontPtr; x:longint; y:longint; s:string; color:longint);
12+procedure gdImageStringUp(im:gdImagePtr; f:gdFontPtr; x:longint; y:longint; s:string; color:longint);
13+procedure gdImageString16(im:gdImagePtr; f:gdFontPtr; x:longint; y:longint; s:string; color:longint);
14+procedure gdImageStringUp16(im:gdImagePtr; f:gdFontPtr; x:longint; y:longint; s:string; color:longint);
15+{$ifdef hasttf}
16+function gdImageStringTTF(im:PgdImage; brect:Plongint; fg:longint; fontlist:string; ptsize:double; angle:double; x:longint; y:longint; astring:string): string;
17+function gdImageStringFT(im:PgdImage; brect:Plongint; fg:longint; fontlist:string; ptsize:double; angle:double; x:longint; y:longint; astring:string):string;
18+{$endif}
19+```
1820
1921These functions will work with both ansistrings and shortstrings; The unit can be compiled in both the {\$H+} as the {\$H-} state.
2022
2123The HASTTF define should be defined for libraries which have TTF2 lib support compiled in. By default, this is not included in the unit, so if you need TrueType Font support, you will need to recomlpile the unit.
2224
2325The **gdtest** example is adapted from the example of the gd unit by Mike Bradbery. It shows how to use the pascal-like functions in the gd unit instead of the raw C like functions which use pchars.
2426
2527the **gdtestcgi** example shows how to output an image to standard output, this can be used for CGI scripts.
2628
2729Go to back [[Package List|Packages List]]
2830
2931---
3032*From the Free Pascal wiki, page "libgd", as it stood on 2013-04-30 after a change by Jwdietrich, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
3133Category: Packages

Back to history