RTF のバックアップ(No.1) - PukiWiki

FrontPage

/// <summary>
/// RTFへ書き込む
/// </summary>
/// <param name="title"></param>
/// <param name="filePath"></param>
private void DrawImage(string title, string filePath)
{
    this.richTextBox1.AppendText(title);

    //Bitmap bitmap = new Bitmap(lstrFile,);
    Image image = Image.FromFile(filePath);
    Bitmap bitmap = new Bitmap(image, 500, 500);
    Clipboard.SetDataObject(bitmap);
    //Clipboard.SetImage(bitmap);

    // Get the format for the object type.
    DataFormats.Format myFormat = DataFormats.GetFormat(DataFormats.Bitmap);
    // After verifying that the data can be pasted, paste
    if (this.richTextBox1.CanPaste(myFormat))
    {
        this.richTextBox1.Paste(myFormat);
    }
    else
    {
        MessageBox.Show("The data format that you attempted site is not supportedby this control.");
    }

    this.richTextBox1.AppendText("\r\n--------------------------------\r\n");

    this.richTextBox1.SaveFile(@"C:\temp\richText.rtf", RichTextBoxStreamType.RichText);

}


トップ   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS

e[NȂECir Yahoo yV LINEf[^[Ōz500~`I
z[y[W ̃NWbgJ[h COiq@COsیI COze