21 |
GD::Image image; |
GD::Image image; |
22 |
image.CreateTrueColor( GD::Size(600,350)); |
image.CreateTrueColor( GD::Size(600,350)); |
23 |
|
|
24 |
GD::TrueColor green(45,95,0); |
//Black color scheme |
25 |
GD::TrueColor text(200,200,200); |
//GD::TrueColor decoration(45,95,0); |
26 |
GD::TrueColor red(255,0,0); |
//GD::TrueColor text(200,200,200); |
27 |
|
//GD::TrueColor line(255,0,0); |
28 |
|
|
29 |
|
//White color scheme |
30 |
|
image.Fill( GD::Point(1,1), GD::TrueColor(255,255,255).Int() ); |
31 |
|
GD::TrueColor decoration(60,60,60); |
32 |
|
GD::TrueColor text(0,0,0); |
33 |
|
GD::TrueColor line(255,0,0); |
34 |
|
|
35 |
|
|
36 |
image.String(gdFontSmall, 250,5, "Temperature graph", text.Int()); |
image.String(gdFontSmall, 250,5, "Temperature graph", text.Int()); |
40 |
std::stringstream marker; |
std::stringstream marker; |
41 |
marker << (100- (i*10)); |
marker << (100- (i*10)); |
42 |
int y = (i*30) + 25; |
int y = (i*30) + 25; |
43 |
image.Line( 30, y, 590, y, green.Int()); |
image.Line( 30, y, 590, y, decoration.Int()); |
44 |
|
|
45 |
image.String(gdFontSmall, 5, y-7, marker.str().c_str(), text.Int()); |
image.String(gdFontSmall, 5, y-7, marker.str().c_str(), text.Int()); |
46 |
|
|
67 |
int x = (i*28) + 40; |
int x = (i*28) + 40; |
68 |
int y = ((100-current) * 3) + 25; |
int y = ((100-current) * 3) + 25; |
69 |
|
|
70 |
//image.FilledArc( GD::Point(x,y), GD::Size(3,3), 0, 360, red.Int(), gdPie); |
//image.FilledArc( GD::Point(x,y), GD::Size(3,3), 0, 360, line.Int(), gdPie); |
71 |
image.FilledRectangle( GD::Point(x-1,y-1), GD::Point(x+1,y+1), red.Int() ); |
image.FilledRectangle( GD::Point(x-1,y-1), GD::Point(x+1,y+1), line.Int() ); |
72 |
|
|
73 |
if (i>0) |
if (i>0) |
74 |
{ |
{ |
75 |
image.Line( GD::Point(x,y), previous, red.Int()); |
image.Line( GD::Point(x,y), previous, line.Int()); |
76 |
} |
} |
77 |
|
|
78 |
previous = GD::Point(x,y); |
previous = GD::Point(x,y); |