- ANSI C
- » Variable handling
- » Miscellaneous
- » POSIX
- » Date/Time
- » Math
- » menu_code_ansiccode_strings
- » PCRE
- » Arrays
- » Classes
- » Program execute
- » Directories
- » Filesystem
- » Memory
- » GD
- » Network
- » Sockets
- PERL
- PHP
- JavaScript
CONTENT
- CHANGES
Szukaj
#top GD¶
code / ansic / GD
#top Makefile¶
Dla ułatwienia korzystania z przykładów został utworzony jeden zbiorczy plik
Makefile kompilujący przykłady użycia poniżej wymienionych funkcji związanych z na zmiennych.Poniższe pliki Makefile zakładają obecność wszystkich plików przykładów, w przypadku chęci kompilacji za pomocą Makefile tylko wybranego przykładu należy zakomentować w pliku Makefile ostatnią pozycję zawierającą listę wszystkich targetów do wykonania
make: $(DIFFTIME) ..., a następnie odkomentować powyżej komendę make zawierającą nazwę targetu dla bieżącego przykładu, np: w przypadku chęci kompilacji tylko przykładu gettimeofday należy zakomentować ostatnią pozycję rozpoczynającą się od make: $(DIFFTIME) ... (wstawić na początku przed make znak #), a następnie odkomentować pozycję: #make: $(DIFFTIME) (usunąć znak #).#top Makefile (linux)¶
SELECT ALL
#top Makefile.obsd¶
SELECT ALL
#top Makefile.fbsd¶
SELECT ALL
#top Makefile.sol¶
SELECT ALL
#top Makefile.beos¶
SELECT ALL
#top Makefile.win¶
SELECT ALL
#top Predefined Constants¶
#top gdMaxColors¶
Deklaracja stałej
gdMaxColors znajduje się w pliku nagłówkowym gd.h.Deklaracja stałej
gdMaxColors jest następująca:
/* The maximum number of palette entries in palette-based images.
In the wonderful new world of gd 2.0, you can of course have
many more colors when using truecolor mode. */
#define gdMaxColors 256
#top Datatypes / MACROS¶
#top struct gdImageStruct¶
Definicja struktury
gdImageStruct znajduje się w pliku nagłówkowym gd.h.Definicja struktury
gdImageStruct jest następująca:
typedef struct gdImageStruct
{
/* Palette-based image pixels */
unsigned char **pixels;
int sx;
int sy;
/* These are valid in palette images only. See also
'alpha', which appears later in the structure to
preserve binary backwards compatibility */
int colorsTotal;
int red[gdMaxColors];
int green[gdMaxColors];
int blue[gdMaxColors];
int open[gdMaxColors];
/* For backwards compatibility, this is set to the
first palette entry with 100% transparency,
and is also set and reset by the
gdImageColorTransparent function. Newer
applications can allocate palette entries
with any desired level of transparency; however,
bear in mind that many viewers, notably
many web browsers, fail to implement
full alpha channel for PNG and provide
support for full opacity or transparency only. */
int transparent;
int *polyInts;
int polyAllocated;
struct gdImageStruct *brush;
struct gdImageStruct *tile;
int brushColorMap[gdMaxColors];
int tileColorMap[gdMaxColors];
int styleLength;
int stylePos;
int *style;
int interlace;
/* New in 2.0: thickness of line. Initialized to 1. */
int thick;
/* New in 2.0: alpha channel for palettes. Note that only
Macintosh Internet Explorer and (possibly) Netscape 6
really support multiple levels of transparency in
palettes, to my knowledge, as of 2/15/01. Most
common browsers will display 100% opaque and
100% transparent correctly, and do something
unpredictable and/or undesirable for levels
in between. TBB */
int alpha[gdMaxColors];
/* Truecolor flag and pixels. New 2.0 fields appear here at the
end to minimize breakage of existing object code. */
int trueColor;
int **tpixels;
/* Should alpha channel be copied, or applied, each time a
pixel is drawn? This applies to truecolor images only.
No attempt is made to alpha-blend in palette images,
even if semitransparent palette entries exist.
To do that, build your image as a truecolor image,
then quantize down to 8 bits. */
int alphaBlendingFlag;
/* Should the alpha channel of the image be saved? This affects
PNG at the moment; other future formats may also
have that capability. JPEG doesn't. */
int saveAlphaFlag;
/* There should NEVER BE ACCESSOR MACROS FOR ITEMS BELOW HERE, so this
part of the structure can be safely changed in new releases. */
/* 2.0.12: anti-aliased globals. 2.0.26: just a few vestiges after
switching to the fast, memory-cheap implementation from PHP-gd. */
int AA;
int AA_color;
int AA_dont_blend;
/* 2.0.12: simple clipping rectangle. These values
must be checked for safety when set; please use
gdImageSetClip *:
int cx1;
int cy1;
int cx2;
int cy2;
}
gdImage;
#top gdImage¶
Definicja type
gdImage znajduje się w pliku nagłówkowym gd.h.Definicja type
gdImage jest następująca:typedef struct gdImageStruct { [...] } gdImage;
#top gdImagePtr¶
Definicja struktury
gdImageStruct znajduje się w pliku nagłówkowym gd.h.Definicja struktury
gdImageStruct jest następująca:typedef gdImage *gdImagePtr;
#top GD Functions¶
#top gdImageCreate¶
Documentacja online: www.boutell.com | www.ironic.com
Deklaracja funkcji
gdImageCreate() znajduje się w pliku nagłówkowym .h.Deklaracja funkcji
gdImageCreate() jest następująca:
/* Creates an image from various file types. These functions
return a palette or truecolor image based on the
nature of the file being loaded. Truecolor PNG
stays truecolor; palette PNG stays palette-based;
JPEG is always truecolor. */
/* Creates a palette-based image (up to 256 colors). */
BGD_DECLARE(gdImagePtr) gdImageCreate (int sx, int sy);
Powiązane:
gdImageCreate(), gdImageCreateTrueColor(), gdImageDestroy(),
Opis:
Funkcja gdImageCreate()
Argumenty:
Zwracana wartość:
Argumenty:
Zwracana wartość:
Example:
zawartość pliku
gdImageCreate.cSELECT ALL
program należy skompilować komendą make (jako argument należy podać plik
Makefile zależny od systemu operacyjnego, domyślnie make próbuje użyć pliku Makefile):make clean all # system Linux make -f Makefile clean all # system Linux make -f Makefile.obsd clean all # system OpenBSD make -f Makefile.fbsd clean all # system FreeBSD make -f Makefile.sol clean all # system Solaris make -f Makefile.beos clean all # system BeOS make -f Makefile.win clean all # system Windows
a następnie uruchomić bez argumentów:
program wyświetli informacje o sposobie uruchamiania programu:
jako argument wywołania programu można podać analogiczne jak poniżej argumenty:
rezultat będzie zależny od podanych argumentów wywołania programu:
#top gdImageCreateTrueColor¶
Documentacja online: pubs.opengroup.org | www.cplusplus.com | pl.wikibooks.org
Deklaracja funkcji
gdImageCreateTrueColor() znajduje się w pliku nagłówkowym gd.h.Deklaracja funkcji
gdImageCreateTrueColor() jest następująca:
/* Creates an image from various file types. These functions
return a palette or truecolor image based on the
nature of the file being loaded. Truecolor PNG
stays truecolor; palette PNG stays palette-based;
JPEG is always truecolor. */
/* Creates a truecolor image (millions of colors). */
BGD_DECLARE(gdImagePtr) gdImageCreateTrueColor (int sx, int sy);
Powiązane:
gdImageCreate(), gdImageCreateTrueColor(), gdImageDestroy(),
Opis:
Funkcja gdImageCreateTrueColor()
Argumenty:
Zwracana wartość:
Argumenty:
Zwracana wartość:
Example:
zawartość pliku
gdImageCreateTrueColor.cSELECT ALL
program należy skompilować komendą make (jako argument należy podać plik
Makefile zależny od systemu operacyjnego, domyślnie make próbuje użyć pliku Makefile):make clean all # system Linux make -f Makefile clean all # system Linux make -f Makefile.obsd clean all # system OpenBSD make -f Makefile.fbsd clean all # system FreeBSD make -f Makefile.sol clean all # system Solaris make -f Makefile.beos clean all # system BeOS make -f Makefile.win clean all # system Windows
a następnie uruchomić bez argumentów:
program wyświetli informacje o sposobie uruchamiania programu:
jako argument wywołania programu można podać analogiczne jak poniżej argumenty:
rezultat będzie zależny od podanych argumentów wywołania programu:
#top gdImageSetClip¶
Documentacja online: pubs.opengroup.org | www.cplusplus.com | pl.wikibooks.org
Deklaracja funkcji
gdImageSetClip() znajduje się w pliku nagłówkowym gd.h.Deklaracja funkcji
gdImageSetClip() jest następująca:/* Solid bar. Upper left corner first, lower right corner second. */ BGD_DECLARE(void) gdImageSetClip(gdImagePtr im, int x1, int y1, int x2, int y2);
Powiązane:
gdImageSetClip(),
Opis:
Funkcja gdImageSetClip()
Argumenty:
Zwracana wartość:
Argumenty:
Zwracana wartość:
#top gdImageDestroy¶
Documentacja online: pubs.opengroup.org | www.cplusplus.com | pl.wikibooks.org
Deklaracja funkcji
gdImageDestroy() znajduje się w pliku nagłówkowym gd.h.Deklaracja funkcji
gdImageDestroy() jest następująca:BGD_DECLARE(void) gdImageDestroy (gdImagePtr im);
Powiązane:
gdImageCreate(), gdImageCreateTrueColor(), gdImageDestroy(),
Opis:
Funkcja gdImageDestroy()
Argumenty:
Zwracana wartość:
Argumenty:
Zwracana wartość:
Zmodyfikowany ostatnio: 2014/04/11 14:09:02 (11 lat temu),
textsize: 12,0 kB,
htmlsize: 20,3 kB
Zapraszam do komentowania, zgłaszania sugestii, propozycji, własnych przykładów, ...
Dodaj komentarzKomentarze użytkowników
