Last change
on this file since 3135 was
3135,
checked in by nico, 14 years ago
|
- Close php blocks in samples programs (add "?>")
|
-
Property svn:executable set to
*
|
File size:
548 bytes
|
Rev | Line | |
---|
[3120] | 1 | #!/usr/bin/php5 |
---|
[3126] | 2 | <?php |
---|
| 3 | |
---|
[3120] | 4 | $img = imagecreatefrompng(dirname(__FILE__)."/logo-caca.png"); |
---|
[3126] | 5 | if (!$img) |
---|
| 6 | die("Can not open image.\n"); |
---|
| 7 | |
---|
[3123] | 8 | $dither = caca_create_dither_gd($img); |
---|
| 9 | if (!$dither) |
---|
| 10 | die("Can not create dither. Maybe this image is not truecolor.\n"); |
---|
| 11 | |
---|
[3120] | 12 | $canvas = caca_create_canvas(0, 0); |
---|
[3122] | 13 | $display = caca_create_display($canvas); |
---|
[3124] | 14 | if (!$display) |
---|
[3123] | 15 | die("Can not create display.\n"); |
---|
[3120] | 16 | |
---|
[3122] | 17 | caca_dither_bitmap_gd($canvas, 0, 0, caca_get_canvas_width($canvas), caca_get_canvas_height($canvas), $dither, $img); |
---|
| 18 | caca_refresh_display($display); |
---|
| 19 | |
---|
| 20 | sleep(5); |
---|
| 21 | |
---|
[3135] | 22 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.