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

Last change on this file since 3126 was 3126, checked in by nico, 12 years ago
  • Add php bindings for 9 functions
  • Modify php bloc headers in samples programs
  • Add list of import/export formats in examples/drivers.php
  • Property svn:executable set to *
File size: 548 bytes
Line 
1#!/usr/bin/php5
2<?php
3
4$img = imagecreatefrompng(dirname(__FILE__)."/logo-caca.png");
5if (!$img)
6        die("Can not open image.\n");
7
8$dither = caca_create_dither_gd($img);
9if (!$dither)
10        die("Can not create dither. Maybe this image is not truecolor.\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_gd($canvas, 0, 0, caca_get_canvas_width($canvas), caca_get_canvas_height($canvas), $dither, $img);
18caca_refresh_display($display);
19
20sleep(5);
21
22
23
24
Note: See TracBrowser for help on using the repository browser.