1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
#include <gd.h>
#include <stdio.h>
#include "gdtest.h"
int main()
{
gdImagePtr im;
int bordercolor, color;
im = gdImageCreateTrueColor(100, 100);
gdImageAlphaBlending(im, 1);
gdImageSaveAlpha(im, 1);
bordercolor = gdImageColorAllocateAlpha(im, 0, 0, 0, 2);
color = gdImageColorAllocateAlpha(im, 0, 0, 0, 1);
gdImageFillToBorder(im, 5, 5, bordercolor, color);
color = gdImageGetPixel(im, 5, 5);
gdImageDestroy(im);
if (gdTestAssert(color==0x1000000)) {
return 0;
} else {
printf("c: %X, expected %X\n", color, 0x1000000);
return -1;
}
}
|