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 <stdio.h>
#include <stdlib.h>
#include "gd.h"
#include "gdtest.h"
int main()
{
gdImagePtr dst_tc, src;
int c1;
src = gdImageCreate(5,5);
gdImageAlphaBlending(src, 0);
gdImageColorAllocate(src, 255,255,255); /* allocate white for background color */
c1 = gdImageColorAllocateAlpha(src, 255,0,0,70);
gdImageFilledRectangle(src, 0,0, 4,4, c1);
dst_tc = gdImageCreateTrueColor(5,5);
gdImageAlphaBlending(dst_tc, 0);
gdImageCopy(dst_tc, src, 0,0, 0,0, gdImageSX(src), gdImageSY(src));
/* CuAssertImageEquals(tc, src, dst_tc); */
/* Destroy it */
gdImageDestroy(dst_tc);
gdImageDestroy(src);
return 0;
}
|