RichTextBox 贴图/使用Graphics在图像上写字

RichTextBox 贴图代码:

             Image img = Image.FromFile(@"G:\Windows\Web\Wallpaper\Windows\img0.jpg");

            Clipboard.SetDataObject(img);

 

            DataFormats.Format  format = DataFormats.GetFormat(DataFormats.Bitmap);

 

            if (richTextBox1.CanPaste(format))

            {

                richTextBox1.Paste(format);

            }

            Clipboard.Clear();

 

在图像的基础上,描绘文字:

            Image img = Image.FromFile(@"G:\Windows\Web\Wallpaper\Windows\img0.jpg");

            Graphics g = Graphics.FromImage(img);

 

            g.DrawString("XXXXX", new Font(this.Font.Name, 12, FontStyle.Bold),Brushes.AliceBlue, 0F, 0F);

 

            g.Dispose();

            this.BackgroundImage = img;

你可能感兴趣的:(windows,Web,image)