当前位置: 首页>>代码示例>>C++>>正文


C++ Color::get_red方法代码示例

本文整理汇总了C++中gdk::Color::get_red方法的典型用法代码示例。如果您正苦于以下问题:C++ Color::get_red方法的具体用法?C++ Color::get_red怎么用?C++ Color::get_red使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gdk::Color的用法示例。


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

示例1: color_to_str

// Gdk::Color -> 16進数表記の文字列
std::string MISC::color_to_str( const Gdk::Color& color )
{
    // R,G,Bを取得
    int l_rgb[3];
    l_rgb[0] = color.get_red();
    l_rgb[1] = color.get_green();
    l_rgb[2] = color.get_blue();

    return color_to_str( l_rgb );
}
开发者ID:shinnya,项目名称:jd-mirror,代码行数:11,代码来源:miscgtk.cpp

示例2: synfigColor

void
Widget_ColorEdit::on_color_changed()
{ 
	//Spike! Gtk::ColorSelection emits this signal when I use 
	//set_current_color(...). It calls recursion. Used a flag to fix it.
	if (!colorHVSChanged)
	{
		Gdk::Color newColor = hvsColorWidget->get_current_color();
		float r = hvs_gamma_in.r_F32_to_F32((float)newColor.get_red() / USHRT_MAX);
		float g = hvs_gamma_in.g_F32_to_F32((float)newColor.get_green() / USHRT_MAX);
		float b = hvs_gamma_in.b_F32_to_F32((float)newColor.get_blue() / USHRT_MAX);
		const synfig::Color synfigColor(r, g, b);
		set_value(synfigColor);
		colorHVSChanged = true; //I reset the flag in setHVSColor(..)
		on_value_changed();
	}
}
开发者ID:jottoprimo,项目名称:synfig,代码行数:17,代码来源:widget_coloredit.cpp

示例3: on_backgroundcolor_changed

/*
 ==================================
 AdvancedOptionsWindow::on_backgroundcolor_changed

 Sets the background colour for profile and the overview.
 ==================================
 */
void AdvancedOptionsWindow::on_backgroundcolor_changed()
{
   Gdk::Color c = backgroundcolorbutton->get_color();
   float red = (float) c.get_red() / 65535.0;
   float green = (float) c.get_green() / 65535.0;
   float blue = (float) c.get_blue() / 65535.0;
   float alpha = (float) backgroundcolorbutton->get_alpha() / 65535.0;
   tdo->set_background_colour(red, green, blue, alpha);
   prof->set_background_colour(red, green, blue, alpha);
   
   if(tdo->get_realized())
   {
      tdo->update_background_colour();
      tdo->drawviewable(1);
   }
   if(prof->get_realized())
   {
      prof->update_background_colour();
      prof->drawviewable(1);
   }
}
开发者ID:arsf,项目名称:lag,代码行数:28,代码来源:AdvancedOptionsWindow.cpp

示例4: catch

  void 
  RLight::guiUpdate()
  {
    try { _intensity = boost::lexical_cast<float>(_intensityEntry->get_text()); } catch (...) {}
    try { _attenuation = boost::lexical_cast<float>(_attenuationEntry->get_text()); } catch (...) {}
    try { _specularExponent = boost::lexical_cast<float>(_specularExponentEntry->get_text()); } catch (...) {}
    try { _specularFactor = boost::lexical_cast<float>(_specularFactorEntry->get_text()); } catch (...) {}

    Gdk::Color color = _lightColor->get_color();
    _color[0] = GLfloat(color.get_red()) / G_MAXUSHORT;
    _color[1] = GLfloat(color.get_green()) / G_MAXUSHORT;
    _color[2] = GLfloat(color.get_blue()) / G_MAXUSHORT;

    try {
      magnet::math::Vector vec;
      vec[0] = boost::lexical_cast<float>(_positionXEntry->get_text());
      vec[1] = boost::lexical_cast<float>(_positionYEntry->get_text());
      vec[2] = boost::lexical_cast<float>(_positionZEntry->get_text());
      setEyeLocationObjSpace(vec);
    } catch (...) {}
  }
开发者ID:pviswanathan,项目名称:DynamO,代码行数:21,代码来源:Light.cpp

示例5: get_paragraph_attributes

  void PrintNotesNoteAddin::get_paragraph_attributes(const Glib::RefPtr<Pango::Layout> & layout,
                                                     double dpiX, 
                                                     int & indentation,
                                                     Gtk::TextIter & position, 
                                                     const Gtk::TextIter & limit,
                                                     std::list<Pango::Attribute> & attributes)
  {
    attributes.clear();
    indentation = 0;

    Glib::SListHandle<Glib::RefPtr<Gtk::TextTag> > tags = position.get_tags();
    position.forward_to_tag_toggle(Glib::RefPtr<Gtk::TextTag>(NULL));
    if (position.compare (limit) > 0) {
      position = limit;
    }

    Glib::RefPtr<Gdk::Screen> screen = get_window()->get_screen();
    double screen_dpiX = screen->get_width_mm() * 254 / screen->get_width();

    for(Glib::SListHandle<Glib::RefPtr<Gtk::TextTag> >::const_iterator iter = tags.begin();
        iter != tags.end(); ++iter) {
      
      Glib::RefPtr<Gtk::TextTag> tag(*iter);

      if (tag->property_paragraph_background_set()) {
        Gdk::Color color = tag->property_paragraph_background_gdk();
        attributes.push_back(Pango::Attribute::create_attr_background(
                               color.get_red(), color.get_green(),
                               color.get_blue()));
      }
      if (tag->property_foreground_set()) {
        Gdk::Color color = tag->property_foreground_gdk();;
        attributes.push_back(Pango::Attribute::create_attr_foreground(
                               color.get_red(), color.get_green(), 
                               color.get_blue()));
      }
      if (tag->property_indent_set()) {
        layout->set_indent(tag->property_indent());
      }
      if (tag->property_left_margin_set()) {                                        
        indentation = (int)(tag->property_left_margin() / screen_dpiX * dpiX);
      }
      if (tag->property_right_margin_set()) {
        indentation = (int)(tag->property_right_margin() / screen_dpiX * dpiX);
      }
//      if (tag->property_font_desc()) {
      attributes.push_back(
        Pango::Attribute::create_attr_font_desc (tag->property_font_desc()));
//      }
      if (tag->property_family_set()) {
        attributes.push_back(
          Pango::Attribute::create_attr_family (tag->property_family()));
      }
      if (tag->property_size_set()) {
        attributes.push_back(Pango::Attribute::create_attr_size (
                               tag->property_size()));
      }
      if (tag->property_style_set()) {
        attributes.push_back(Pango::Attribute::create_attr_style (
                               tag->property_style()));
      }
      if (tag->property_underline_set() 
          && tag->property_underline() != Pango::UNDERLINE_ERROR) {
        attributes.push_back(
          Pango::Attribute::create_attr_underline (
            tag->property_underline()));
      }
      if (tag->property_weight_set()) {
        attributes.push_back(
          Pango::Attribute::create_attr_weight(
            Pango::Weight(tag->property_weight().get_value())));
      }
      if (tag->property_strikethrough_set()) {
        attributes.push_back(
          Pango::Attribute::create_attr_strikethrough (
            tag->property_strikethrough()));
      }
      if (tag->property_rise_set()) {
        attributes.push_back(Pango::Attribute::create_attr_rise (
                               tag->property_rise()));
      }
      if (tag->property_scale_set()) {
        attributes.push_back(Pango::Attribute::create_attr_scale (
                               tag->property_scale()));
      }
      if (tag->property_stretch_set()) {
        attributes.push_back(Pango::Attribute::create_attr_stretch (
                               tag->property_stretch()));
      }
    }
  }
开发者ID:mattiklock,项目名称:gnote,代码行数:91,代码来源:printnotesnoteaddin.cpp

示例6: setSinIdCel

/**
 Establece el color de la celula sin determinar.
 @param sic, Gdk::Color que contiene el valor del color de las celulas sin identificarD.
 */
void DibujadoCelula::setSinIdCel(Gdk::Color sic)
{
	sinIdCelR = (sic.get_red()/divisor);
	sinIdCelG = (sic.get_green()/divisor);
	sinIdCelB = (sic.get_blue()/divisor);
}
开发者ID:nihatefe,项目名称:govocitiuss,代码行数:10,代码来源:DibujadoCelula.cpp

示例7: setSeleCel

/**
 Establece el color de la celula seleccionada.
 @param sc, Gdk::Color que contiene el valor del color de la seleccion.
 */
void DibujadoCelula::setSeleCel(Gdk::Color sc)
{
	seleCelR = (sc.get_red()/divisor);
	seleCelG = (sc.get_green()/divisor);
	seleCelB = (sc.get_blue()/divisor);
}
开发者ID:nihatefe,项目名称:govocitiuss,代码行数:10,代码来源:DibujadoCelula.cpp

示例8: setEdiCel

/**
 Establece el color de edicion.
 @param ec, Gdk::Color que contiene el valor del color de la edicion.
 */
void DibujadoCelula::setEdiCel(Gdk::Color ec)
{
	ediCelR = (ec.get_red()/divisor);
	ediCelG = (ec.get_green()/divisor);
	ediCelB = (ec.get_blue()/divisor);
}
开发者ID:nihatefe,项目名称:govocitiuss,代码行数:10,代码来源:DibujadoCelula.cpp

示例9: applySettings


//.........这里部分代码省略.........
            mangler->integration->setClient((MusicClient)id);
        } else {
            mangler->integration->setClient(MusicClient_None);
        }
    }
    mangler->integration->update(true);

    // Voice Activation
    builder->get_widget("settingsEnableVoiceActivationCheckButton", checkbutton);
    Mangler::config["VoiceActivationEnabled"] = checkbutton->get_active();
    builder->get_widget("settingsVoiceActivationSilenceDurationSpinButton", spinbutton);
    Mangler::config["VoiceActivationSilenceDuration"] = spinbutton->get_value() * 1000.0;
    builder->get_widget("settingsVoiceActivationSensitivitySpinButton", spinbutton);
    Mangler::config["VoiceActivationSensitivity"] = spinbutton->get_value_as_int();

#ifdef HAVE_XOSD
    // On-Screen Display
    builder->get_widget("settingsEnableOnScreenDisplayCheckButton", checkbutton);
    Mangler::config["OnScreenDisplayEnabled"] = checkbutton->get_active();
    if (checkbutton->get_active()) {
        Gtk::TreeModel::iterator pos_iter = osdPosition->get_active();
        if (pos_iter) {
            int vert_pos_int = (*pos_iter)[osdPositionColumns.id];
            Mangler::config["OnScreenDisplayVerticalPosition"] = vert_pos_int;
        }
        Gtk::TreeModel::iterator aln_iter = osdAlignment->get_active();
        if (aln_iter) {
            int horz_aln_int = (*aln_iter)[osdAlignmentColumns.id];
            Mangler::config["OnScreenDisplayHorizontalAlignment"] = horz_aln_int;
        }
        Mangler::config["OnScreenDisplayFontSize"] = osdFontSize->get_value();
        Gdk::Color color = osdColor->get_color();
        char colorstr[16];
        snprintf(colorstr, 15, "#%02x%02x%02x", color.get_red() / 256, color.get_green() / 256, color.get_blue() / 256);
        Mangler::config["OnScreenDisplayColor"] = colorstr;
        mangler->osd->destroyOsd();
    }
#endif

    // Audio Devices
    iter = inputDeviceComboBox->get_active();
    if (iter) {
        Gtk::TreeModel::Row row = *iter;
        Mangler::config["InputDeviceName"] = Glib::ustring( row[inputColumns.name] );
    }
    Mangler::config["InputDeviceCustomName"] = inputDeviceCustomName->get_text();
    iter = outputDeviceComboBox->get_active();
    if (iter) {
        Gtk::TreeModel::Row row = *iter;
        Mangler::config["OutputDeviceName"] = Glib::ustring( row[outputColumns.name] );
    }
    Mangler::config["OutputDeviceCustomName"] = outputDeviceCustomName->get_text();
    iter = notificationDeviceComboBox->get_active();
    if (iter) {
        Gtk::TreeModel::Row row = *iter;
        Mangler::config["NotificationDeviceName"] = Glib::ustring( row[notificationColumns.name] );
    }
    Mangler::config["NotificationDeviceCustomName"] = notificationDeviceCustomName->get_text();
    iter = audioSubsystemComboBox->get_active();
    if (iter) {
        Gtk::TreeModel::Row row = *iter;
        Mangler::config["AudioSubsystem"] = Glib::ustring( row[audioSubsystemColumns.id] );
    }

    // Master Volume
    Mangler::config["MasterVolumeLevel"] = volumeAdjustment->get_value();
开发者ID:Isanderthul,项目名称:mangler,代码行数:67,代码来源:manglersettings.cpp


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