Ignore:
Timestamp:
Oct 30, 2008, 5:16:31 PM (12 years ago)
Author:
nico
Message:
  • Improve php binding of caca_render_canvas
  • Destroy php resource in caca_file_close
  • Improve sample program render.php
File:
1 edited

Legend:

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

    r3149 r3150  
    2626echo caca_export_string($canvas, "utf8");
    2727
    28 $img = imagecreatetruecolor(400, 300);
    2928$font = caca_load_builtin_font("Monospace Bold 12");
     29
     30$width = caca_get_canvas_width($canvas) * caca_get_font_width($font);
     31$height = caca_get_canvas_height($canvas) * caca_get_font_height($font);
     32
     33$img = imagecreatetruecolor($width, $height);
     34
    3035caca_render_canvas($canvas, $font, $img);
    3136
Note: See TracChangeset for help on using the changeset viewer.