source: libcaca/trunk/caca-php/examples/dithering.php @ 3154

Last change on this file since 3154 was 3154, checked in by nico, 12 years ago
  • Modify error message in sample program dithering.php
  • Property svn:executable set to *
File size: 623 bytes
Line 
1#!/usr/bin/php5
2<?php
3$img = imagecreatefrompng(dirname(__FILE__)."/logo-caca.png");
4//$img = imagecreatefromgif(dirname(__FILE__)."/logo-caca-idx.gif");
5if (!$img)
6        die("Can not open image.\n");
7
8$dither = caca_create_dither($img);
9if (!$dither)
10        die("Can not create dither. Maybe you compiled caca-php without gd support.\n");
11
12$canvas = caca_create_canvas(0, 0);
13$display = caca_create_display($canvas);
14if (!$display)
15        die("Can not create display.\n");
16
17caca_dither_bitmap($canvas, 0, 0, caca_get_canvas_width($canvas), caca_get_canvas_height($canvas), $dither, $img);
18caca_refresh_display($display);
19
20sleep(5);
21
22?>
Note: See TracBrowser for help on using the repository browser.