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

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