當前位置: 首頁>>代碼示例>>C#>>正文


C# ColorConverter.ConvertToString方法代碼示例

本文整理匯總了C#中System.Drawing.ColorConverter.ConvertToString方法的典型用法代碼示例。如果您正苦於以下問題:C# ColorConverter.ConvertToString方法的具體用法?C# ColorConverter.ConvertToString怎麽用?C# ColorConverter.ConvertToString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Drawing.ColorConverter的用法示例。


在下文中一共展示了ColorConverter.ConvertToString方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: ToString

 private string ToString(object value)
 {
     var buttons = (ButtonsCaption)value;    // Gelen object tipimizi ButtonsCaption tipine dönüştürüyoruz ve ayıklama işlemine başlıyoruz.
     var converter = new ColorConverter();
     return String.Format("{0}, {1}",
         converter.ConvertToString(buttons.ActiveCaptionButtonsColor), converter.ConvertToString(buttons.InactiveCaptionButtonsColor));
 }
開發者ID:KelvinCoding,項目名稱:masterwork-dwarf-fortress,代碼行數:7,代碼來源:ButtonsCaptionConverter.cs

示例2: ToString

 private string ToString(object value)
 {
     var gradient = value as GradientTab;    // Gelen object tipimizi GradientTab tipine dönüştürüyoruz ve ayıklama işlemine başlıyoruz.
     var converter = new ColorConverter();
     return String.Format("{0}, {1}, {2}, {3}, {4}, {5}",
         converter.ConvertToString(gradient.ColorStart), converter.ConvertToString(gradient.ColorEnd), gradient.GradientStyle, converter.ConvertToString(gradient.TabPageTextColor), converter.ConvertToString(gradient.TabPageSelectedTextColor), gradient.SelectedTabFontStyle);
 }
開發者ID:KelvinCoding,項目名稱:masterwork-dwarf-fortress,代碼行數:7,代碼來源:GradientTabConverter.cs

示例3: ConvertToString

		/// <summary>
		///		Convierte un valor a una cadena
		/// </summary>
		public new string ConvertToString(object objValue)
		{ StyleBauControl objStyle = (StyleBauControl) objValue;
			ColorConverter objConverter = new ColorConverter();
			string strConvert;
			
					// Obtiene la cadena formateada con los valores numéricos
						strConvert = objStyle.RoundCorners.ToString() + ",";
						strConvert = objStyle.AngleCorners.ToString() + ",";
						strConvert += objStyle.ShadowThickness.ToString() + ",";
						strConvert += objStyle.BorderWidth.ToString() + ",";
					// Obtiene la cadena formateada con los colores
						strConvert += objConverter.ConvertToString(objStyle.BorderColor) + ",";
						strConvert += objConverter.ConvertToString(objStyle.BackgroundColor) + ",";
						strConvert += objConverter.ConvertToString(objStyle.BackgroundGradientColor) + ",";
						strConvert += objConverter.ConvertToString(objStyle.ShadowColor) + ",";
						strConvert += objConverter.ConvertToString(objStyle.ForeColor) + ",";
					// Obtiene la cadena formateada con el modo del gradiante
						strConvert += ((int) objStyle.GradientMode).ToString();
					// Devuelve la cadena
						return strConvert;
		}
開發者ID:jbautistam,項目名稱:BauXmppMessenger,代碼行數:24,代碼來源:StyleBauControlConverter.cs

示例4: Save

        internal void Save(XmlWriter writer)
        {
            writer.WriteStartElement("fullScreenViewer");

              ResizerConverter rsConv = new ResizerConverter();

              writer.WriteStartElement("resizer");
              writer.WriteAttributeString("value", (string)rsConv.ConvertTo(null, null, resizer, typeof(string)));
              writer.WriteEndElement();

              EnumConverter ipConv = new EnumConverter(typeof(InterpolationMode));

              writer.WriteStartElement("interpolationMode");
              writer.WriteAttributeString("value", ipConv.ConvertToString(interpolationMode));
              writer.WriteEndElement();

              ColorConverter colorConv = new ColorConverter();

              writer.WriteStartElement("backColor");
              writer.WriteAttributeString("value", colorConv.ConvertToString(backColor));
              writer.WriteEndElement();

              writer.WriteEndElement();
        }
開發者ID:hazychill,項目名稱:oog,代碼行數:24,代碼來源:FullScreenViewerSettings.cs

示例5: SaveProjectToolStripMenuItem_Click

        public void SaveProjectToolStripMenuItem_Click(System.Object sender, System.EventArgs e)
        {
            save = "";
            save = System.Convert.ToString(xn + "_" + yn + "_" + zn + "_" + agent + "_");

            for (var i = 1; i <= agent; i++)
            {
                save = save + generator.Default.agentname[i] + "_";
            }

            for (var i = 1; i <= agent; i++)
            {
                save = save + generator.Default.agentcount[i] + "_";
            }

            for (var i = 1; i <= agent; i++)
            {
                save = save + generator.Default.initialenergy[i] + "_";
            }

            for (var i = 1; i <= agent; i++)
            {
                save = save + generator.Default.stepenergy[i] + "_";
            }

            for (var i = 1; i <= agent; i++)
            {
                save = save + generator.Default.bumpenergy[i] + "_";
            }

            for (var i = 1; i <= agent; i++)
            {
                save = save + generator.Default.aging[i] + "_";
            }

            for (var i = 1; i <= agent; i++)
            {
                save = save + generator.Default.agelimit[i] + "_";
            }

            for (var i = 1; i <= agent; i++)
            {
                save = save + generator.Default.asr[i] + "_";
            }

            for (var i = 1; i <= agent; i++)
            {
                save = save + generator.Default.asrtime[i] + "_";
            }

            for (var i = 1; i <= agent; i++)
            {
                save = save + generator.Default.asrenergy[i] + "_";
            }

            for (var i = 1; i <= agent; i++)
            {
                System.Drawing.ColorConverter colourconverter = new System.Drawing.ColorConverter();
                save = save + colourconverter.ConvertToString(generator.Default.agentcolour[i]) + "_";
            }

            for (var i = 1; i <= agent; i++)
            {
                save = save + generator.Default.agentrangeabsolute[i] + "_";
            }

            for (var a = 1; a <= agent; a++)
            {
                for (var b = 0; b <= 2; b++)
                {
                    for (var c = 0; c <= 1; c++)
                    {
                        save = save + generator.Default.agentrange[a, b, c] + "_";
                    }
                }
            }

            for (var a = 1; a <= agent; a++)
            {
                for (var b = 1; b <= agent; b++)
                {
                    for (var c = 1; c <= 6; c++)
                    {
                        save = save + generator.Default.action[a, b, c] + "_";
                    }
                }
            }

            save = save + "|";
            SaveFilepro.ShowDialog();
        }
開發者ID:andrew-x,項目名稱:COBWEB-3D,代碼行數:91,代碼來源:Form1.cs

示例6: Save

        internal void Save(XmlWriter writer)
        {
            writer.WriteStartElement("thumbnail");

              SizeConverter sizeConv = new SizeConverter();

              writer.WriteStartElement("size");
              writer.WriteAttributeString("value", sizeConv.ConvertToString(size));
              writer.WriteEndElement();

              EnumConverter ipConv = new EnumConverter(typeof(InterpolationMode));

              writer.WriteStartElement("interpolationMode");
              writer.WriteAttributeString("value", ipConv.ConvertToString(interpolationMode));
              writer.WriteEndElement();

              ColorConverter colorConv = new ColorConverter();

              writer.WriteStartElement("backColor");
              writer.WriteAttributeString("value", colorConv.ConvertToString(backColor));
              writer.WriteEndElement();

              EnumConverter priorityConv = new EnumConverter(typeof(ThreadPriority));

              writer.WriteStartElement("threadPriority");
              writer.WriteAttributeString("value", priorityConv.ConvertToString(threadPriority));
              writer.WriteEndElement();

              writer.WriteEndElement();
        }
開發者ID:hazychill,項目名稱:oog,代碼行數:30,代碼來源:ThumbnailSetting.cs

示例7: ConvertToString_Name

 public void ConvertToString_Name(string name)
 {
     var conv = new ColorConverter();
     Assert.Equal(name, conv.ConvertToString(Color.FromName(name)));
 }
開發者ID:geoffkizer,項目名稱:corefx,代碼行數:5,代碼來源:ColorConverterTests.cs

示例8: ConvertTo

            public override object ConvertTo(
                ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
            {
                if (destinationType == typeof(string))
                {
                    BackColorBlend cb = value as BackColorBlend;

                    if (cb != null)
                    {
                        ColorConverter cvt = new ColorConverter();

                        if (cb.Colors != null)
                        {
                            if (cb.Colors[0] != Color.Empty)
                                return (cvt.ConvertToString(cb.Colors[0]));

                            if (cb.Colors.Length > 1 && cb.Colors[1] != Color.Empty)
                                return (cvt.ConvertToString(cb.Colors[1]));
                        }
                    }

                    return (String.Empty);
                }

                return (base.ConvertTo(context, culture, value, destinationType));
            }
開發者ID:huamanhtuyen,項目名稱:VNACCS,代碼行數:26,代碼來源:BackColorBlend.cs

示例9: ToString

 private string ToString(object value)
 {
     TooltipRenderer tRenderer = value as TooltipRenderer;
     TypeConverter converter = new ColorConverter();
     return String.Format("{0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}",
         converter.ConvertToString(tRenderer.BorderColor),
         converter.ConvertToString(tRenderer.TitleForeColor),
         converter.ConvertToString(tRenderer.MessageForeColor),
         converter.ConvertToString(tRenderer.LightBackgroundColor),
         converter.ConvertToString(tRenderer.DarkBackgroundColor),
         tRenderer.Radius,
         converter.ConvertToString(tRenderer.BarBorderColor),
         converter.ConvertToString(tRenderer.BarBackgroundColorStart),
         converter.ConvertToString(tRenderer.BarBackgroundColorEnd),
         converter.ConvertToString(tRenderer.BarProgressColorStart),
         converter.ConvertToString(tRenderer.BarProgressColorEnd));
 }
開發者ID:wxll1120,項目名稱:c585b99f,代碼行數:17,代碼來源:TooltipRenderer.cs

示例10: ToString

 private string ToString(object value)
 {
     GradientFill fill = (GradientFill)value;
     ColorConverter converter = new ColorConverter();
     return String.Format("{0}, {1}, {2}", converter.ConvertToString(fill.ColorA), converter.ConvertToString(fill.ColorB), fill.GradientFillStyle.ToString());
 }
開發者ID:ehershey,項目名稱:development,代碼行數:6,代碼來源:GradientFillConverter.cs

示例11: SetColor

 public void SetColor(string key, Color color)
 {
     ColorConverter fc = new ColorConverter();
     _htSettings[key] = fc.ConvertToString(color);
 }
開發者ID:rusutaku,項目名稱:csharp-tororo-gui,代碼行數:5,代碼來源:guiSettings.cs

示例12: ToString

 private string ToString(object value)
 {
     CaptionGradient gradient = value as CaptionGradient;    // Gelen object tipimizi CaptionGradient tipine dönüştürüyoruz ve ayıklama işlemine başlıyoruz.
     ColorConverter converter = new ColorConverter();
     return String.Format("{0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}",
         converter.ConvertToString(gradient.ActiveCaptionColorStart), converter.ConvertToString(gradient.ActiveCaptionColorEnd),
         converter.ConvertToString(gradient.InactiveCaptionColorStart), converter.ConvertToString(gradient.InactiveCaptionColorEnd), gradient.CaptionGradientStyle,
         converter.ConvertToString(gradient.InactiveCaptionTextColor), converter.ConvertToString(gradient.ActiveCaptionTextColor), gradient.ActiveCaptionFontStyle);
 }
開發者ID:KelvinCoding,項目名稱:masterwork-dwarf-fortress,代碼行數:9,代碼來源:CaptionGradientConverter.cs

示例13: ConvertTo

        public override object ConvertTo(ITypeDescriptorContext context,
            System.Globalization.CultureInfo culture, object value, Type destinationType)
        {
            //將對象轉換為字符串:"Black,1"
            if (destinationType == typeof(string))
            {
                TabControlBorderStyle style = value as TabControlBorderStyle;
                TypeConverter converter = new ColorConverter();

                return string.Format("{0},{1}", converter.ConvertToString(style.Color), style.Width.ToString());
            }

            return base.ConvertTo(context, culture, value, destinationType);
        }
開發者ID:wxll1120,項目名稱:c585b99f,代碼行數:14,代碼來源:TabControlBorderStyle.cs

示例14: ConvertTo

        public override object ConvertTo(
            ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
        {
            if (destinationType == typeof(string))
            {
                Background gc = value as Background;

                if (gc != null)
                {
                    if (gc.BackColorBlend != null && gc.BackColorBlend.IsEmpty == false)
                        return ("Blended");

                    ColorConverter cvt = new ColorConverter();

                    string s = gc.Color1.IsEmpty ? "(Empty)" : cvt.ConvertToString(gc.Color1);

                    if (gc.Color2 != Color.Empty)
                        s += ", " + cvt.ConvertToString(gc.Color2);

                    return (s);
                }
            }

            return (base.ConvertTo(context, culture, value, destinationType));
        }
開發者ID:huamanhtuyen,項目名稱:VNACCS,代碼行數:25,代碼來源:Background.cs

示例15: ConvertToString

 public void ConvertToString(int a, int r, int g, int b)
 {
     var conv = new ColorConverter();
     var str = conv.ConvertToString(Color.FromArgb(a, r, g, b));
     Assert.Equal(string.Format("{0}{4} {1}{4} {2}{4} {3}", a, r, g, b, CultureInfo.CurrentCulture.TextInfo.ListSeparator), str);
 }
開發者ID:geoffkizer,項目名稱:corefx,代碼行數:6,代碼來源:ColorConverterTests.cs


注:本文中的System.Drawing.ColorConverter.ConvertToString方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。