• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ agg::slider_ctrl类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中agg::slider_ctrl的典型用法代码示例。如果您正苦于以下问题:C++ slider_ctrl类的具体用法?C++ slider_ctrl怎么用?C++ slider_ctrl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了slider_ctrl类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: on_draw

  virtual void on_draw() {
    agg::rasterizer_scanline_aa<> pf;
    agg::scanline_p8 sl;

    typedef agg::renderer_base<pixfmt> renderer_base;

    pixfmt pixf(rbuf_window());
    renderer_base rb(pixf);

    rb.clear(agg::rgba(1, 1, 1));

    agg::ellipse e1;
    agg::conv_transform<agg::ellipse> t1(e1, trans_affine_resizing());

    unsigned i;
    unsigned n_drawn = 0;
    for (i = 0; i < m_num_points; i++) {
      double z = m_points[i].z;
      double alpha = 1.0;
      if (z < m_scale_ctrl_z.value1()) {
        alpha = 1.0 - (m_scale_ctrl_z.value1() - z) *
                          m_slider_ctrl_sel.value() * 100.0;
      }

      if (z > m_scale_ctrl_z.value2()) {
        alpha = 1.0 - (z - m_scale_ctrl_z.value2()) *
                          m_slider_ctrl_sel.value() * 100.0;
      }

      if (alpha > 1.0) alpha = 1.0;
      if (alpha < 0.0) alpha = 0.0;

      if (alpha > 0.0) {
        e1.init(m_points[i].x, m_points[i].y, m_slider_ctrl_size.value() * 5.0,
                m_slider_ctrl_size.value() * 5.0, 8);
        pf.add_path(t1);

        agg::render_scanlines_aa_solid(
            pf, sl, rb, agg::rgba(m_points[i].color.r, m_points[i].color.g,
                                  m_points[i].color.b, alpha));
        n_drawn++;
      }
    }

    agg::render_ctrl(pf, sl, rb, m_scale_ctrl_z);
    agg::render_ctrl(pf, sl, rb, m_slider_ctrl_sel);
    agg::render_ctrl(pf, sl, rb, m_slider_ctrl_size);

    char buf[10];
    sprintf(buf, "%08u", n_drawn);

    agg::gsv_text txt;
    txt.size(15.0);
    txt.text(buf);
    txt.start_point(10.0, initial_height() - 20.0);
    agg::gsv_text_outline<> txt_o(txt, trans_affine_resizing());
    pf.add_path(txt_o);
    agg::render_scanlines_aa_solid(pf, sl, rb, agg::rgba(0, 0, 0));
  }
开发者ID:UIKit0,项目名称:agg,代码行数:59,代码来源:circles.cpp


示例2: on_idle

 virtual void on_idle()
 {
     unsigned i;
     for(i = 0; i < m_num_points; i++)
     {
         m_points[i].x += random_dbl(0, m_slider_ctrl_sel.value()) - m_slider_ctrl_sel.value()*0.5;
         m_points[i].y += random_dbl(0, m_slider_ctrl_sel.value()) - m_slider_ctrl_sel.value()*0.5;
         m_points[i].z += random_dbl(0, m_slider_ctrl_sel.value()*0.01) - m_slider_ctrl_sel.value()*0.005;
         if(m_points[i].z < 0.0) m_points[i].z = 0.0;
         if(m_points[i].z > 1.0) m_points[i].z = 1.0;
     }
     force_redraw();
 }
开发者ID:Bashakov,项目名称:agg,代码行数:13,代码来源:circles.cpp


示例3:

  the_application(agg::pix_format_e format, bool flip_y, unsigned num_points)
      : agg::platform_support(format, flip_y),
        m_num_points(num_points),
        m_points(new scatter_point[num_points]),
        m_scale_ctrl_z(5, 5, start_width - 5, 12, !flip_y),
        m_slider_ctrl_sel(5, 20, start_width - 5, 27, !flip_y),
        m_slider_ctrl_size(5, 35, start_width - 5, 42, !flip_y) {

    m_spline_r.init(6, spline_r_x, spline_r_y);
    m_spline_g.init(6, spline_g_x, spline_g_y);
    m_spline_b.init(6, spline_b_x, spline_b_y);

    add_ctrl(m_scale_ctrl_z);
    add_ctrl(m_slider_ctrl_sel);
    add_ctrl(m_slider_ctrl_size);

    m_slider_ctrl_size.label("Size");
    m_slider_ctrl_sel.label("Selectivity");
  }
开发者ID:UIKit0,项目名称:agg,代码行数:19,代码来源:circles.cpp


示例4: draw_aliased

    void draw_aliased()
    {
        pixfmt pixf(rbuf_window());
        renderer_base rb(pixf);
        renderer_bin ren_bin(rb);

        agg::path_storage path;
        

        path.move_to(m_x[0] - 200, m_y[0]);
        path.line_to(m_x[1] - 200, m_y[1]);
        path.line_to(m_x[2] - 200, m_y[2]);
        path.close_polygon();

        ren_bin.color(agg::rgba(0.1, 0.5, 0.7, m_alpha.value()));

        m_ras.gamma(agg::gamma_threshold(m_gamma.value()));
        m_ras.add_path(path);
        agg::render_scanlines(m_ras, m_sl_bin, ren_bin);

        //-- Drawing an outline with subpixel accuracy (aliased)
        //typedef agg::renderer_primitives<renderer_base> renderer_pr;
        //renderer_pr ren_pr(rb);
        //agg::rasterizer_outline<renderer_pr> ras_line(ren_pr);
        //ren_pr.line_color(agg::rgba(0.0, 0.0, 0.0));
        //ras_line.add_path(path);
    }
开发者ID:GordonSmith,项目名称:agg,代码行数:27,代码来源:rasterizers.cpp


示例5:

    the_application(agg::pix_format_e format, bool flip_y) :
        agg::platform_support(format, flip_y),
        m_feng(),
        m_fman(m_feng),
        m_poly1(6, 5.0),
        m_poly2(6, 5.0),
        m_num_points      (5.0, 5.0, 340.0, 12.0, !flip_y),
        m_fixed_len       (350, 5.0,  "Fixed Length", !flip_y),
        m_preserve_x_scale(465, 5.0,  "Preserve X scale", !flip_y),
        m_animate         (350, 25.0, "Animate", !flip_y),
        m_prev_animate(false)
    {
        add_ctrl(m_fixed_len);
        add_ctrl(m_preserve_x_scale);
        add_ctrl(m_animate);
        m_fixed_len.status(true);
        m_preserve_x_scale.status(true);
        m_num_points.range(10.0, 400.0);
        m_num_points.value(200.0);
        m_num_points.label("Number of intermediate Points = %.3f");
        add_ctrl(m_num_points);

        m_poly1.close(false);
        m_poly2.close(false);
    }
开发者ID:4nakin,项目名称:CorsixTH-Android,代码行数:25,代码来源:trans_curve2_ft.cpp


示例6: on_key

    virtual void on_key(int x, int y, unsigned key, unsigned flags)
    {
        if(key == ' ')
        {

            agg::trans_affine mtx;
            mtx *= agg::trans_affine_translation((m_min_x + m_max_x) * -0.5, (m_min_y + m_max_y) * -0.5);
            mtx *= agg::trans_affine_scaling(m_scale.value());
            mtx *= agg::trans_affine_rotation(agg::deg2rad(m_rotate.value()));
            mtx *= agg::trans_affine_translation((m_min_x + m_max_x) * 0.5, (m_min_y + m_max_y) * 0.5);
            mtx *= agg::trans_affine_translation(m_x, m_y);

            double m[6];
            mtx.store_to(m);

            char buf[128];
            sprintf(buf, "%3.3f, %3.3f, %3.3f, %3.3f, %3.3f, %3.3f",
                         m[0], m[1], m[2], m[3], m[4], m[5]);

            message(buf);
            FILE* fd = fopen("transform.txt", "a");
            fprintf(fd, "%s\n", buf);
            fclose(fd);
        }
    }
开发者ID:gkliska,项目名称:razvoj,代码行数:25,代码来源:svg_test.cpp


示例7: on_idle

    //------------------------------------------------------------------------
    virtual void on_idle() 
    {
        bool redraw = false;
        if(m_rotate_polygon.status())
        {
            m_polygon_angle.value(m_polygon_angle.value() + 0.5);
            if(m_polygon_angle.value() >= 180.0) 
            {
                m_polygon_angle.value(m_polygon_angle.value() - 360.0);
            }
            redraw = true;
        }

        if(m_rotate_pattern.status())
        {
            m_pattern_angle.value(m_pattern_angle.value() - 0.5);
            if(m_pattern_angle.value() <= -180.0) 
            {
                m_pattern_angle.value(m_pattern_angle.value() + 360.0);
            }
            generate_pattern();
            redraw = true;
        }

        if(redraw) force_redraw();

    }
开发者ID:Bashakov,项目名称:agg,代码行数:28,代码来源:pattern_fill.cpp


示例8: on_idle

    void on_idle()
    {
        if(m_run.status())
        {
            if(m_cur_angle < 360.0)
            {
                m_cur_angle += m_step.value();
                copy_img_to_img(1, 0);
#ifdef AGG_ACCURATE_TIME
                start_timer();
#endif
                transform_image(m_step.value());
#ifdef AGG_ACCURATE_TIME
                m_time2 += elapsed_time();
#endif
                m_num_steps++;
            }
            else
            {
                m_cur_angle = 0.0;
#ifndef AGG_ACCURATE_TIME
                m_time2 = clock();
#endif
                wait_mode(true);
                m_run.status(false);
            }
            force_redraw();
        }
        else
        {
            wait_mode(true);
        }
    }
开发者ID:foogywoo,项目名称:drone,代码行数:33,代码来源:image_filters.cpp


示例9: on_mouse_button_down

  //------------------------------------------------------------------------
  virtual void on_mouse_button_down(int x, int y, unsigned flags) {
    if (flags & agg::mouse_left) {
      if (sqrt((x - m_image_cx) * (x - m_image_cx) +
               (y - m_image_cy) * (y - m_image_cy)) < 5.0) {
        m_dx = x - m_image_cx;
        m_dy = y - m_image_cy;
        m_flag = 1;
      } else {
        agg::rasterizer_scanline_aa<> ras;
        agg::trans_affine polygon_mtx;

        polygon_mtx *=
            agg::trans_affine_translation(-m_polygon_cx, -m_polygon_cy);
        polygon_mtx *= agg::trans_affine_rotation(m_polygon_angle.value() *
                                                  agg::pi / 180.0);
        polygon_mtx *= agg::trans_affine_scaling(m_polygon_scale.value(),
                                                 m_polygon_scale.value());
        polygon_mtx *=
            agg::trans_affine_translation(m_polygon_cx, m_polygon_cy);

        agg::path_storage ps;
        create_star(ps);

        agg::conv_transform<agg::path_storage> tr(ps, polygon_mtx);
        ras.add_path(tr);
        if (ras.hit_test(x, y)) {
          m_dx = x - m_polygon_cx;
          m_dy = y - m_polygon_cy;
          m_flag = 2;
        }
      }
    }
  }
开发者ID:UIKit0,项目名称:agg,代码行数:34,代码来源:image_transforms.cpp


示例10: on_idle

    //------------------------------------------------------------------------
    virtual void on_idle() 
    {
        bool redraw = false;
        if(m_rotate_polygon.status())
        {
            m_polygon_angle.value(m_polygon_angle.value() + 0.5);
            if(m_polygon_angle.value() >= 180.0) 
            {
                m_polygon_angle.value(m_polygon_angle.value() - 360.0);
            }
            redraw = true;
        }

        if(m_rotate_image.status())
        {
            m_image_angle.value(m_image_angle.value() + 0.5);
            if(m_image_angle.value() >= 180.0) 
            {
                m_image_angle.value(m_image_angle.value() - 360.0);
            }
            redraw = true;
        }

        if(redraw) force_redraw();

    }
开发者ID:4nakin,项目名称:CorsixTH-Android,代码行数:27,代码来源:image_transforms.cpp


示例11: on_draw

    virtual void on_draw()
    {
        prim_pixfmt_type pixf(rbuf_window());
        prim_ren_base_type rb(pixf);
        rb.clear(agg::rgba8(255, 255, 255));

        generate_color_ramp(m_ramp1, 
                            agg::rgba(0, 0, 0, m_alpha_dst.value()),
                            agg::rgba(0, 0, 1, m_alpha_dst.value()),
                            agg::rgba(0, 1, 0, m_alpha_dst.value()),
                            agg::rgba(1, 0, 0, 0));

        generate_color_ramp(m_ramp2, 
                            agg::rgba(0, 0, 0, m_alpha_src.value()),
                            agg::rgba(0, 0, 1, m_alpha_src.value()),
                            agg::rgba(0, 1, 0, m_alpha_src.value()),
                            agg::rgba(1, 0, 0, 0));

        render_scene(rb);
        agg::renderer_scanline_aa_solid<prim_ren_base_type> ren(rb);

        agg::render_ctrl_rs(m_ras, m_sl, ren, m_alpha_dst);
        agg::render_ctrl_rs(m_ras, m_sl, ren, m_alpha_src);
        agg::render_ctrl_rs(m_ras, m_sl, ren, m_comp_op);
    }
开发者ID:ONLYOFFICE,项目名称:core,代码行数:25,代码来源:compositing2.cpp


示例12:

 the_application(agg::pix_format_e format, bool flip_y) :
     agg::platform_support(format, flip_y),
     m_quad1(4, 5.0),
     m_quad2(4, 5.0),
     m_trans_type(420, 5.0, 420+130.0, 145.0, !flip_y),
     m_reset     (350, 5.0,  "Reset", !flip_y),
     m_mul1      (5.0,  5.0, 340.0, 12.0, !flip_y),
     m_mul2      (5.0, 20.0, 340.0, 27.0, !flip_y)
 {
     m_trans_type.add_item("Union");
     m_trans_type.add_item("Intersection");
     m_trans_type.add_item("Linear XOR");
     m_trans_type.add_item("Saddle XOR");
     m_trans_type.add_item("Abs Diff XOR");
     m_trans_type.add_item("A-B");
     m_trans_type.add_item("B-A");
     m_trans_type.cur_item(0);
     add_ctrl(m_trans_type);
     add_ctrl(m_reset);
     add_ctrl(m_mul1);
     add_ctrl(m_mul2);
     m_mul1.value(1.0);
     m_mul2.value(1.0);
     m_mul1.label("Opacity1=%.3f");
     m_mul2.label("Opacity2=%.3f");
 }
开发者ID:zshipko,项目名称:libtwombly,代码行数:26,代码来源:scanline_boolean.cpp


示例13:

 the_application(agg::pix_format_e format, bool flip_y) :
     agg::platform_support(format, flip_y),
     m_alpha(5, 5, 320-5, 10+5, !flip_y)
 {
     m_alpha.label("Alpha=%1.0f");
     m_alpha.range(0, 255);
     m_alpha.value(255);
     add_ctrl(m_alpha);
 }
开发者ID:GordonSmith,项目名称:agg,代码行数:9,代码来源:component_rendering.cpp


示例14: draw_curve

 void draw_curve(Pattern& patt, 
                 Rasterizer& ras, 
                 Renderer& ren, 
                 PatternSource& src, 
                 VertexSource& vs)
 {
     patt.create(src);
     ren.scale_x(m_scale_x.value());
     ren.start_x(m_start_x.value());
     ras.add_path(vs);
 }
开发者ID:Bashakov,项目名称:agg,代码行数:11,代码来源:line_patterns.cpp


示例15: on_draw

    virtual void on_draw()
    {
        pixfmt pixf(rbuf_window());
        renderer_base rb(pixf);
        renderer_solid r(rb);

        rb.clear(agg::rgba(1, 1, 1));

        agg::trans_warp_magnifier lens;
        lens.center(g_x1, g_y1);
        lens.magnification(m_magn_slider.value());
        lens.radius(m_radius_slider.value() / m_magn_slider.value());

        agg::conv_segmentator<agg::path_storage> segm(g_path);

        agg::trans_affine mtx;
        mtx *= agg::trans_affine_translation(-g_base_dx, -g_base_dy);
        mtx *= agg::trans_affine_rotation(g_angle + agg::pi);
        mtx *= agg::trans_affine_translation(width()/2, height()/2);

        agg::conv_transform<
            agg::conv_segmentator<
                agg::path_storage> > trans_mtx(segm, mtx);

        agg::conv_transform<
            agg::conv_transform<
                agg::conv_segmentator<
                    agg::path_storage> >, agg::trans_warp_magnifier> trans_lens(trans_mtx, lens);

        agg::render_all_paths(g_rasterizer, g_scanline, r, trans_lens, g_colors, g_path_idx, g_npaths);

        agg::render_ctrl(g_rasterizer, g_scanline, rb, m_magn_slider);
        agg::render_ctrl(g_rasterizer, g_scanline, rb, m_radius_slider);


        // Testing inverse_transform()
        //--------------------
        //double x, y;
        //for(y = 0; y < height(); y += 10)
        //{
        //    for(x = 0; x < height(); x += 10)
        //    {
        //        double x2 = x+0.5;
        //        double y2 = y+0.5;
        //        lens.transform(&x2, &y2);
        //        lens.inverse_transform(&x2, &y2);
        //        agg::ellipse e(x2, y2, 1, 1);
        //        g_rasterizer.add_path(e);
        //        r.color(agg::rgba8(0,0,0));
        //        agg::render_scanlines(g_rasterizer, g_scanline, r);
        //    }
        //}
    }
开发者ID:ONLYOFFICE,项目名称:core,代码行数:53,代码来源:lion_lens.cpp


示例16:

    the_application(agg::pix_format_e format, bool flip_y) :
        agg::platform_support(format, flip_y),
        m_rotate(10,  3, "Rotate", !flip_y),
        m_even_odd(60, 3, "Even-Odd", !flip_y),
        m_draft(130, 3, "Draft", !flip_y),
        m_roundoff(175, 3, "Roundoff", !flip_y),
        m_angle_delta(10, 21, 250-10, 27, !flip_y),
        m_redraw_flag(true)
    {
        m_angle_delta.label("Step=%4.3f degree");

        g_attr[g_npaths++] = path_attributes(g_path.start_new_path(),
                                             agg::rgba8(255, 255, 0),
                                             agg::rgba8(0,   0,   0),
                                             1.0);

        g_path.concat_poly(g_poly_bulb, AGG_POLY_SIZE(g_poly_bulb), true);

        g_attr[g_npaths++] = path_attributes(g_path.start_new_path(),
                                             agg::rgba8(255,  255, 200),
                                             agg::rgba8(90,   0,   0),
                                             0.7);

        g_path.concat_poly(g_poly_beam1, AGG_POLY_SIZE(g_poly_beam1), true); 
        g_path.concat_poly(g_poly_beam2, AGG_POLY_SIZE(g_poly_beam2), true); 
        g_path.concat_poly(g_poly_beam3, AGG_POLY_SIZE(g_poly_beam3), true); 
        g_path.concat_poly(g_poly_beam4, AGG_POLY_SIZE(g_poly_beam4), true); 

        g_attr[g_npaths++] = path_attributes(g_path.start_new_path(),
                                             agg::rgba8(0, 0, 0),
                                             agg::rgba8(0, 0, 0),
                                             0.0);

        g_path.concat_poly(g_poly_fig1, AGG_POLY_SIZE(g_poly_fig1), true); 
        g_path.concat_poly(g_poly_fig2, AGG_POLY_SIZE(g_poly_fig2), true); 
        g_path.concat_poly(g_poly_fig3, AGG_POLY_SIZE(g_poly_fig3), true); 
        g_path.concat_poly(g_poly_fig4, AGG_POLY_SIZE(g_poly_fig4), true); 
        g_path.concat_poly(g_poly_fig5, AGG_POLY_SIZE(g_poly_fig5), true); 
        g_path.concat_poly(g_poly_fig6, AGG_POLY_SIZE(g_poly_fig6), true); 

        m_rotate.text_size(7);
        m_even_odd.text_size(7);
        m_draft.text_size(7);
        m_roundoff.text_size(7);
        add_ctrl(m_rotate);
        add_ctrl(m_even_odd);
        add_ctrl(m_draft);
        add_ctrl(m_roundoff);
        add_ctrl(m_angle_delta);
        m_angle_delta.value(0.01);
    }
开发者ID:Rodeo314,项目名称:vasFMC,代码行数:51,代码来源:idea.cpp


示例17:

    the_application(agg::pix_format_e format, bool flip_y) :
        agg::platform_support(format, flip_y),
        m_ctrl_color(agg::rgba(0, 0.3, 0.5, 0.3)),
        m_line1(5),
        m_scale_x(5.0,   5.0, 240.0, 12.0, !flip_y),
        m_start_x(250.0, 5.0, 495.0, 12.0, !flip_y)
    {
        m_line1.line_color(m_ctrl_color);
        m_line1.xn(0) = 20;
        m_line1.yn(0) = 20;
        m_line1.xn(1) = 500-20;
        m_line1.yn(1) = 500-20;
        m_line1.xn(2) = 500-60;
        m_line1.yn(2) = 20;
        m_line1.xn(3) = 40;
        m_line1.yn(3) = 500-40;
        m_line1.xn(4) = 100;
        m_line1.yn(4) = 300;
        m_line1.close(false);

        add_ctrl(m_line1);
        m_line1.transform(m_scale);

        m_scale_x.label("Scale X=%.2f");
        m_scale_x.range(0.2, 3.0);
        m_scale_x.value(1.0);
        add_ctrl(m_scale_x);
        m_scale_x.no_transform();

        m_start_x.label("Start X=%.2f");
        m_start_x.range(0.0, 10.0);
        m_start_x.value(0.0);
        add_ctrl(m_start_x);
        m_start_x.no_transform();
    }
开发者ID:asmboom,项目名称:PixelFarm,代码行数:35,代码来源:line_patterns_clip.cpp


示例18:

    the_application(agg::pix_format_e format, bool flip_y) :
        agg::platform_support(format, flip_y),
        m_idx(-1),
        m_gamma(130 + 10.0, 10.0 + 4.0, 130 + 150.0, 10.0 + 8.0 + 4.0, !flip_y),
        m_alpha(130 + 150.0 + 10.0, 10.0 + 4.0, 500 - 10.0, 10.0 + 8.0 + 4.0, !flip_y),
        m_test(130 + 10.0, 10.0 + 4.0 + 16.0,    "Test Performance", !flip_y)
    {
        m_x[0] = 100 + 120; m_y[0] = 60;
        m_x[1] = 369 + 120; m_y[1] = 170;
        m_x[2] = 143 + 120; m_y[2] = 310;

        add_ctrl(m_gamma);
        m_gamma.range(0.0, 1.0);
        m_gamma.value(0.5);
        m_gamma.label("Gamma=%1.2f");
        m_gamma.no_transform();

        add_ctrl(m_alpha);
        m_alpha.range(0.0, 1.0);
        m_alpha.value(1.0);
        m_alpha.label("Alpha=%1.2f");
        m_alpha.no_transform();

        add_ctrl(m_test);
        m_test.no_transform();
    }
开发者ID:GordonSmith,项目名称:agg,代码行数:26,代码来源:rasterizers.cpp


示例19:

    the_application(agg::pix_format_e format, bool flip_y) :
        agg::platform_support(format, flip_y),
        m_idx(-1),
        m_radius(10, 10, 600-10,   19,    !flip_y),
        m_gamma(10, 10+20, 600-10, 19+20, !flip_y),
        m_offset(10, 10+40, 600-10, 19+40, !flip_y),
        m_white_on_black(10, 10+60, "White on black")
    {
        m_x[0] = 100;   m_y[0] = 100;
        m_x[1] = 500;   m_y[1] = 350;
        add_ctrl(m_radius);
        add_ctrl(m_gamma);
        add_ctrl(m_offset);
        add_ctrl(m_white_on_black);
        m_gamma.label("gamma=%4.3f");
        m_gamma.range(0.0, 3.0);
        m_gamma.value(1.8);

        m_radius.label("radius=%4.3f");
        m_radius.range(0.0, 50.0);
        m_radius.value(25.0);

        m_offset.label("subpixel offset=%4.3f");
        m_offset.range(-2.0, 3.0);

        m_white_on_black.text_color(agg::rgba8(127, 127, 127));
        m_white_on_black.inactive_color(agg::rgba8(127, 127, 127));
    }
开发者ID:Rodeo314,项目名称:vasFMC,代码行数:28,代码来源:rounded_rect.cpp


示例20: on_draw

    virtual void on_draw()
    {
        typedef agg::gamma_lut<agg::int8u, agg::int8u, 8, 8> gamma_lut_type;
        typedef agg::pixfmt_bgr24_gamma<gamma_lut_type> pixfmt;
        typedef agg::renderer_base<pixfmt> renderer_base;
        typedef agg::renderer_scanline_aa_solid<renderer_base> renderer_solid;

        gamma_lut_type gamma(m_gamma.value());
        pixfmt pixf(rbuf_window(), gamma);
        renderer_base rb(pixf);
        renderer_solid ren(rb);

        rb.clear(m_white_on_black.status() ? agg::rgba(0,0,0) : agg::rgba(1,1,1));

        agg::rasterizer_scanline_aa<> ras;
        agg::scanline_p8 sl;

        agg::ellipse e;

        // Render two "control" circles
        ren.color(agg::rgba8(127,127,127));
        e.init(m_x[0], m_y[0], 3, 3, 16);
        ras.add_path(e);
        agg::render_scanlines(ras, sl, ren);
        e.init(m_x[1], m_y[1], 3, 3, 16);
        ras.add_path(e);
        agg::render_scanlines(ras, sl, ren);

        double d = m_offset.value();

        // Creating a rounded rectangle
        agg::rounded_rect r(m_x[0]+d, m_y[0]+d, m_x[1]+d, m_y[1]+d, m_radius.value());
        r.normalize_radius();

        // Drawing as an outline
        agg::conv_stroke<agg::rounded_rect> p(r);
        p.width(1.0);
        ras.add_path(p);
        ren.color(m_white_on_black.status() ? agg::rgba(1,1,1) : agg::rgba(0,0,0));
        agg::render_scanlines(ras, sl, ren);

        ras.gamma(agg::gamma_none());

        // Render the controls
        agg::render_ctrl(ras, sl, rb, m_radius);
        agg::render_ctrl(ras, sl, rb, m_gamma);
        agg::render_ctrl(ras, sl, rb, m_offset);
        agg::render_ctrl(ras, sl, rb, m_white_on_black);
    }
开发者ID:Rodeo314,项目名称:vasFMC,代码行数:49,代码来源:rounded_rect.cpp



注:本文中的agg::slider_ctrl类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ agg::trans_affine类代码示例发布时间:2022-05-31
下一篇:
C++ agg::rendering_buffer类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap