PageRenderTime 23ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 0ms

/hphp/test/zend/good/ext/gd/tests/bug40764.php

http://github.com/facebook/hiphop-php
PHP | 21 lines | 17 code | 4 blank | 0 comment | 0 complexity | e638f278226cebc045e128bd8c3df521 MD5 | raw file
Possible License(s): LGPL-2.1, BSD-2-Clause, BSD-3-Clause, MPL-2.0-no-copyleft-exception, MIT, LGPL-2.0, Apache-2.0
  1. <?hh <<__EntryPoint>> function main(): void {
  2. $image=imagecreatetruecolor(400, 400);
  3. $white = imagecolorallocate($image, 255, 255, 255);
  4. $black = imagecolorallocate($image, 0, 0, 0);
  5. $red = imagecolorallocate($image, 255, 0, 0);
  6. imagefill($image, 0, 0, $white);
  7. imagesetthickness($image, 10);
  8. imageline($image, 200, 0, 200, 400, $black);
  9. imageline($image, 0, 200, 400, 200, $black);
  10. imageline($image, 0, 0, 392, 392, $black);
  11. imagesetthickness($image, 1);
  12. imageline($image, 200, 0, 200, 400, $red);
  13. imageline($image, 0, 200, 400, 200, $red);
  14. imageline($image, 0, 0, 392, 392, $red);
  15. print_r(imagecolorat($image, 195, 0));
  16. print_r(imagecolorat($image, 0, 195));
  17. }