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)+4) / 4);
  39.     $obj->numPoint = 8;
  40.     $obj->lenPoint = 70;
  41.     $obj->transparent = true;
  42.     $obj->x = $pos['x'];
  43.     $obj->y = $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.  
  55. //Új szöveg létrehozása
  56. $text5 = new Text('Törpi a sztár',32,-10);
  57. $text5->quality = 100;
  58. $text5->setX($graph->width/2,1);
  59. $text5->setY($graph->height-1,2);
  60. $text5->backGround = $graph->createColor(255,0,255);
  61. $text5->transparent = true;
  62. $text5->color = $graph->createColor(255,0,0);
  63. $text5->type ='gif';
  64. //szöveg hozzáadása a grafikához
  65. $graph->add($text5);
  66.  
  67. //Új szöveg
  68. $text6 = new Text('Törpi a sztár',31,-10);
  69. $text6->quality = 100;
  70. $text6->setX($graph->width /2,1);
  71. $text6->setY($graph->height,2);
  72. $text6->backGround = $graph->createColor(0,0,0);
  73. $text6->transparent = true;
  74. $text6->color = $graph->createColor(255,255,0);
  75. $text6->type = 'gif';
  76. //szöveg hozzáadása a grafikához
  77. $graph->add($text6);
  78.  
  79. //Új csillag elem létrehozása
  80. $csillag = new Star(30);
  81. $csillag->numPoint = 5;
  82. $csillag->lenPoint = 20;
  83. $csillag->transparent = true;
  84. $csillag->color = $graph->createColor(255,255,0);
  85. $csillag->angle = -20;
  86. $csillag->type = 'gif';
  87. $csillag->x = $text6->x - ($text6->width / 2);
  88. $csillag->y = $text6->y;
  89.  
  90. //csillag hozzáadása a grafikához
  91. $graph->add($csillag);
  92.  
  93.  
  94. $ora = new AnalogClock(70,mktime(7,10,30));
  95. $ora->x = $graph->width-$ora->width/2;
  96. $ora->y = $graph->height-$ora->height/2;
  97. $ora->background = $ora->createColor(0,0,130);
  98. $ora->transparent = true;
  99. $graph->add($ora);
  100.  
  101.  
  102. //grafika minősége
  103. $graph->quality = 100;
  104. //grafika megjelenítése
  105. $graph->flush();
  106. ?>

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