1 //test program for png code, uses ct8bp mode to draw a red and white heart
\r
2 //in 1 2 4 and 8 bit per pixel modes.
\r
7 pngwrite,classes,sysutils;
\r
11 imagedata : array[0..10] of array [0..10] of byte=(
\r
12 (0,0,0,0,0,0,0,0,0,0,0),
\r
13 (0,0,1,1,1,0,1,1,1,0,0),
\r
14 (0,1,1,1,1,0,1,1,1,1,0),
\r
15 (0,1,1,1,1,1,1,1,1,1,0),
\r
16 (0,1,1,1,1,1,1,1,1,1,0),
\r
17 (0,1,1,1,1,1,1,1,1,1,0),
\r
18 (0,0,1,1,1,1,1,1,1,0,0),
\r
19 (0,0,0,1,1,1,1,1,0,0,0),
\r
20 (0,0,0,0,1,1,1,0,0,0,0),
\r
21 (0,0,0,0,0,1,0,0,0,0,0),
\r
22 (0,0,0,0,0,0,0,0,0,0,0)
\r
24 paldata : array[0..5] of byte=(255,255,255,255,0,0);
\r
26 outer,counter : integer;
\r
27 stream : tfilestream;
\r
30 for outer := 0 to 3 do begin
\r
32 stream := tfilestream.Create('heart'+inttostr(1 shl outer)+'.png',fmCreate{fmOpenWrite} or fmShareDenyNone );
\r
34 pngstart(f,stream,1 shl outer,ct8bp,11,11);
\r
35 pngwritepal(f,@paldata,2);
\r
38 for counter := 0 to 10 do begin
\r
39 pngwritescanline(f,@imagedata[counter]);
\r