using system;using system.collections.specialized;using system.drawing;using system.drawing.imaging;using system.io;using system.runtime.interopservices;using system.text;using system.windows.forms;
#region public enums 【程序编程相关:(原创)解密JScript.Encode】
namespace khendys.controls { 【推荐阅读:昨日关注:C-omega vs ADO.】
#endregion 【扩展信息:C#教学经验谈(2):会跑的按钮】
// enum for possible rtf colors public enum rtfcolor { black, maroon, green, olive, navy, purple, teal, gray, silver, red, lime, yellow, blue, fuchsia, aqua, white }
public class exrichtextbox : system.windows.forms.richtextbox {
#region my enums
// specifies the flags/options for the unmanaged call to the gdi+ method // metafile.emftowmfbits(). private enum emftowmfbitsflags {
// use the default conversion emftowmfbitsflagsdefault = 0x00000000,
// embedded the source of the emf metafiel within the resulting wmf // metafile emftowmfbitsflagsembedemf = 0x00000001,
// place a 22-byte header in the resulting wmf file. the header is // required for the metafile to be considered placeable. emftowmfbitsflagsincludeplaceable = 0x00000002,
// dont simulate clipping by using the xor operator. emftowmfbitsflagsnoxorclip = 0x00000004 };
#endregion
#region my structs
// definitions for colors in an rtf document private struct rtfcolordef { public const string black = @"\red0\green0\blue0"; public const string maroon = @"\red128\green0\blue0"; public const string green = @"\red0\green128\blue0"; public const string olive = @"\red128\green128\blue0"; public const string navy = @"\red0\green0\blue128"; public const string purple = @"\red128\green0\blue128"; public const string teal = @"\red0\green128\blue128"; public const string gray = @"\red128\green128\blue128"; public const string silver = @"\red192\green192\blue192"; public const string red = @"\red255\green0\blue0"; public const string lime = @"\red0\green255\blue0"; public const string yellow = @"\red255\green255\blue0"; public const string blue = @"\red0\green0\blue255"; public const string fuchsia = @"\red255\green0\blue255"; public const string aqua = @"\red0\green255\blue255"; public const string white = @"\red255\green255\blue255"; }
// control words for rtf font families private struct rtffontfamilydef { public const string unknown = @"\fnil"; public const string roman = @"\froman"; public const string swiss = @"\fswiss"; public const string modern = @"\fmodern"; public const string script = @"\fscript"; public const string decor = @"\fdecor"; public const string technical = @"\ftech"; public const string bidirect = @"\fbidi"; }
#endregion
#region my constants
// not used in this application. descriptions can be found with documentation // of windows gdi function setmapmode private const int mm_text = 1; private const int mm_lometric = 2; private const int mm_himetric = 3; private const int mm_loenglish = 4; private const int mm_hienglish = 5; private const int mm_twips = 6;
// ensures that the metafile maintains a 1:1 aspect ratio private const int mm_isotropic = 7;
// allows the x-coordinates and y-coordinates of the metafile to be adjusted // independently private const int mm_anisotropic = 8;
// represents an unknown font family private const string ff_unknown = "unknown";
// the number of hundredths of millimeters (0.01 mm) in an inch // for more information, see getimageprefix() method. private const int hmm_per_inch = 2540;
// the number of twips in an inch // for more information, see getimageprefix() method. private const int twips_per_inch = 1440;
#endregion
... 下一页