⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rtfcolortable.cs

📁 xhtml到rtf的转换程序!带源码!
💻 CS
字号:
using System;
using System.Collections;
using System.Drawing;

namespace RichTextBoxSupportsXHTML
{
	/// <summary>
	/// Summary description for RtfColorTable.
	/// </summary>
	public class RtfColorTable
	{
		private int numberOfColors = 0;
		private string colortbl;
		private Hashtable loadedColors = new Hashtable();

		public RtfColorTable()
		{
			//
			// TODO: Add constructor logic here
			//
			colortbl = "{\\colortbl;";
		}

		public int UseColor(Color key)
		{
			if (loadedColors.ContainsKey(key))
			{
				return (int)loadedColors[key];
			}
			else
			{
				colortbl += "\\red" + key.R + "\\green" + key.G + "\\blue" + key.B + ";";
				loadedColors.Add(key, ++numberOfColors);
				return numberOfColors;
			}
		}

		public override string ToString()
		{
			return colortbl + "}";
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -