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;