Changeset 468 for trunk/Modules/Meteostation/Meteostation.php
- Timestamp:
- Dec 16, 2012, 10:46:34 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Meteostation/Meteostation.php
r467 r468 1 1 <?php 2 3 include_once('../../Common/Image.php'); 2 4 3 5 class PageMeteo extends Page … … 11 13 class MeteoStation extends AppModule 12 14 { 13 15 var $Data; 16 14 17 function __construct($Database, $System) 15 18 { … … 48 51 'RelHumidity' => $Data['RelHumidity'], 'AbsHumidity' => $Data['AbsHumidity'], 49 52 'DewPoint' => $Data['DewPoint'])); 53 $this->Data = $Data; 50 54 } 51 55 … … 56 60 { 57 61 $this->DownloadData($DbRow['Id'], $DbRow['URL']); 62 $this->CreateImage('cache/'.$DbRow['Id'].'.png'); 58 63 } 64 } 65 66 function CreateImage($FileName) 67 { 68 $Image = new Image(); 69 $Image->SetSize(150, 150); 70 $Image->Brush->Color = COLOR_WHITE; 71 $Image->FillRect(0, 0, $Image->GetWidth(), $Image->GetHeight()); 72 //$Image->Font->Color = COLOR_RED; 73 //$Image->Line(10, 10, 100, 100); 74 $Image->TextOut(10, 10, 'Meteo Koliba Zděchov'); 75 $Image->TextOut(10, 30, 'Teplote: '.$this->Data['Temperature'].' °C'); 76 $Image->SaveToFile($FileName); 59 77 } 60 78
Note:
See TracChangeset
for help on using the changeset viewer.