Ignore:
Timestamp:
Oct 27, 2008, 8:35:48 PM (12 years ago)
Author:
nico
Message:
  • Add a "caca_create_dither_gd" function that create the proper dither for a given gd resource.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/caca-php/examples/dithering.php

    r3122 r3123  
    22<?
    33$img = imagecreatefrompng(dirname(__FILE__)."/logo-caca.png");
     4$dither = caca_create_dither_gd($img);
     5if (!$dither)
     6        die("Can not create dither. Maybe this image is not truecolor.\n");
     7
    48$canvas = caca_create_canvas(0, 0);
    5 
    6 $dither = caca_create_dither(32, 128, 128, 4 * 128, 0x00ff0000, 0x0000ff00, 0x000000ff, 0x00000000);
    7 
    89$display = caca_create_display($canvas);
    9 caca_set_display_time($display, 80000);
     10if (!$dither)
     11        die("Can not create display.\n");
    1012
    1113caca_dither_bitmap_gd($canvas, 0, 0, caca_get_canvas_width($canvas), caca_get_canvas_height($canvas), $dither, $img);
Note: See TracChangeset for help on using the changeset viewer.