Source for file fullExample.php

Documentation is available at fullExample.php

  1. <?php
  2. /**
  3.  * Graph osztály importálása
  4.  */
  5. require_once('../Graph.class.php');
  6.  
  7. //Az összes grafikus elem importálása
  8. //Az összes iterátor importálása
  9.  
  10. //Új grafika létrehozása 300x300 méretben
  11. $graph new Graph(300,300);
  12. $graph->setBackGround(0,0,255);
  13. $graph->transparent true;
  14. $graph->type "gif"
  15.         
  16. //Új kép létrehozása
  17. $image new Image('pezsgo.jpg');
  18. $image->setX($graph->width 2,1);
  19. $image->setY($graph->height 2,1);
  20. $image->cut(8,85,130,180);
  21. $image->quality 10;
  22. $image->transparent false;
  23. $image->angle 0;
  24. $image->type='gif';
  25.  
  26. //kép hozzáadása a grafikához
  27. $graph->add($image);
  28.  
  29. //ellipszis iterátor létrehozása
  30. $iterator new EllipseIterator(150,150,200,150);
  31. $iterator->add 10;
  32. $iterator->start = -180;
  33. $iterator->end = -540;
  34.  
  35. $isize 10;
  36. //Ellipszis vonalán végig csillagok kirajzolása
  37. foreach($iterator as $pos{
  38.     $obj new Star((abs($isize)+44);
  39.     $obj->numPoint 8;
  40.     $obj->lenPoint 70;
  41.     $obj->transparent true;
  42.     $obj->$pos['x'];
  43.     $obj->$pos['y'];
  44.     $obj->type 'gif';
  45.     $obj->angle 30;
  46.     $obj->quality 100;
  47.     $obj->color $graph->createColor(255,255,0);
  48.     $obj->borderColor $graph->createColor(200,0,0);
  49.     
  50.     $graph->add($obj);
  51.     $isize+=10;
  52.   
  53.  
  54. //Új szöveg létrehozása
  55. $text5 new Text('Törpi a sztár',32,-10);
  56. $text5->quality 100;
  57. $text5->setX($graph->width/2,1);
  58. $text5->setY($graph->height-1,2);
  59. $text5->backGround $graph->createColor(255,0,255);
  60. $text5->transparent true;
  61. $text5->color $graph->createColor(255,0,0);
  62. $text5->type ='gif';
  63. //szöveg hozzáadása a grafikához
  64. $graph->add($text5);
  65.  
  66. //Új szöveg
  67. $text6 new Text('Törpi a sztár',31,-10);
  68. $text6->quality 100;
  69. $text6->setX($graph->width /2,1);
  70. $text6->setY($graph->height,2);
  71. $text6->backGround $graph->createColor(0,0,0);
  72. $text6->transparent true;
  73. $text6->color $graph->createColor(255,255,0);
  74. $text6->type 'gif';
  75. //szöveg hozzáadása a grafikához
  76. $graph->add($text6);
  77.  
  78. //Új csillag elem létrehozása
  79. $csillag new Star(30);
  80. $csillag->numPoint 5;
  81. $csillag->lenPoint 20;
  82. $csillag->transparent true;
  83. $csillag->color $graph->createColor(255,255,0);
  84. $csillag->angle = -20;
  85. $csillag->type 'gif';
  86. $csillag->$text6->($text6->width 2);
  87. $csillag->$text6->y;
  88.  
  89. //csillag hozzáadása a grafikához
  90. $graph->add($csillag);
  91.  
  92.  
  93. $ora new AnalogClock(70,mktime(7,10,30));
  94. $ora->$graph->width-$ora->width/2;
  95. $ora->$graph->height-$ora->height/2;
  96. $ora->background $ora->createColor(0,0,130);
  97. $ora->transparent true;
  98. $graph->add($ora);
  99.  
  100.  
  101. //grafika minősége
  102. $graph->quality 100;
  103. //grafika megjelenítése
  104. $graph->flush();
  105. ?>

Documentation generated on Tue, 09 Feb 2010 01:17:48 +0100 by phpDocumentor 1.4.1