richtextbox控件|在RichTextBox控件加入图片

更新时间:2014-03-27    来源:组件控件开发    手机版     字体:

【www.bbyears.com--组件控件开发】

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;
namespace Khendys.Controls {
 #region Public Enums
 // Enum for possible RTF colors
 public enum RtfColor {
    Black, Maroon, Green, Olive, Navy, Purple, Teal, Gray, Silver,
    Red, Lime, Yellow, Blue, Fuchsia, Aqua, White
 }
 #endregion
 
 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,
     // Don't simulate clipping by using the XOR operator.

本文来源:http://www.bbyears.com/asp/5169.html