Example #1
0
    void draw_bar( graphics& gx, UINT width, UINT height, int n_bar, int total_bars, color c, double val )
    {
        double bar_width = double(width) / (2*total_bars);
        double bar_height = double(height - 2) * val * (double(step)/double(steps-1));

        double bar_x1 = bar_width/2 + n_bar * 2 * bar_width;
        double bar_x2 = bar_x1 + bar_width;
        double bar_y2 = height - 0.5;
        double bar_y1 = bar_y2 - bar_height;

        color c_outline(0,0,0,0);

        gx.line_color(c_outline);
        gx.line_width(3);
        
        COLOR_STOP cs[3] = 
        {
          { gcolor(c) , 0.0f },
          { gcolor(0xff,0xff,0xff), 0.33f },
          { gcolor(c), 1.0f }
        };
        gx.fill_linear_gradient( bar_x1,bar_y1,bar_x2,bar_y1, cs, 3);

        gx.rectangle(bar_x1,bar_y1,bar_x2,bar_y2,6,6,0,0);
    }
 void draw_caption( HELEMENT he, graphics& gx, UINT width, UINT height, aux::wchars text )
 {
     gx.state_save();
       //gx.rotate(3.1415926 / 2, width / 2, height / 3); // for text rotation testing.
       gx.text_alignment(TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER);
       gx.font("Times New Roman", 18);
       gx.no_line();
       gx.fill_linear_gradient( width/3,0,(2*width)/3, 0, color(0xDF,0,0), color(0,0,0x7F));
       gx.text(width / 2, height / 3, text);
       //gx.rectangle(0,0,width / 2, height / 3);
     gx.state_restore();
 }