Jump to content

GD Clock


dfwcomputer

Recommended Posts

Hi all,

 

i currently have a clock that uses GD to draw.It works fine but, it draws like follows;

 

$clock = new AnalogClock(128); // Create a 128x128 pixel clock
$clock->timezone = +9; // GMT -0600

/* These affect the way the clock looks */
$clock->Alias(TRUE); // Turn on anti-aliasing
$clock->Background('bg.gif'); // Add a background image

/* The clock's hands */
$clock->NewHand('hour', 'line', '000000', 20, 3, TRUE);
$clock->NewHand('min', 'line', '000000', 35, 3, TRUE);

$clock->DrawOverlay('plain-overlay.png');
$clock->DrawPNG(); // Output as a PNG

 

is there away to change this so it uses echo.

 

e.g.

 


$output = "DrawPNG()";

$clock = new AnalogClock(128); // Create a 128x128 pixel clock
$clock->timezone = +9; // GMT -0600

/* These affect the way the clock looks */
$clock->Alias(TRUE); // Turn on anti-aliasing
$clock->Background('bg.gif'); // Add a background image

/* The clock's hands */
$clock->NewHand('hour', 'line', '000000', 20, 3, TRUE);
$clock->NewHand('min', 'line', '000000', 35, 3, TRUE);

$clock->DrawOverlay('plain-overlay.png');

echo "$output";

 

This obviously does not work but its the best way i could explain it.

 

Thanks

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/84828-gd-clock/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.