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

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