在RichTextBox控件加入图片

作者:袖梨 2022-07-02
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.

相关文章

精彩推荐