ChartSheet.CopyPicture 方法

Microsoft.Office.Tools.Excel.ChartSheet 作为图片复制到剪贴板。

命名空间:  Microsoft.Office.Tools.Excel
程序集:  Microsoft.Office.Tools.Excel(在 Microsoft.Office.Tools.Excel.dll 中)

语法

声明
Sub CopyPicture ( _
    Appearance As XlPictureAppearance, _
    Format As XlCopyPictureFormat, _
    Size As XlPictureAppearance _
)
void CopyPicture(
    XlPictureAppearance Appearance,
    XlCopyPictureFormat Format,
    XlPictureAppearance Size
)

参数

备注

可选参数

有关可选参数的信息,请参见Office 解决方案中的可选参数

示例

下面的代码示例使用 CopyPicture 方法将当前 Microsoft.Office.Tools.Excel.ChartSheet 作为位图复制到剪贴板。

Private Sub CopyChartSheetAsBitmap()
    Globals.Sheet1.Range("A1", "A5").Value2 = 22
    Globals.Sheet1.Range("B1", "B5").Value2 = 55

    Me.SetSourceData(Globals.Sheet1.Range("A1", "B5"), _
        Excel.XlRowCol.xlColumns)
    Me.ChartType = Excel.XlChartType.xlColumnClustered

    Me.CopyPicture(Excel.XlPictureAppearance.xlScreen, _
        Excel.XlCopyPictureFormat.xlBitmap, _
        Excel.XlPictureAppearance.xlScreen)
End Sub
private void CopyChartSheetAsBitmap()
{
    Globals.Sheet1.Range["A1", "A5"].Value2 = 22;
    Globals.Sheet1.Range["B1", "B5"].Value2 = 55;

    this.SetSourceData(Globals.Sheet1.Range["A1", "B5"],
        Excel.XlRowCol.xlColumns);
    this.ChartType = Excel.XlChartType.xlColumnClustered;

    this.CopyPicture(Excel.XlPictureAppearance.xlScreen,
        Excel.XlCopyPictureFormat.xlBitmap,
        Excel.XlPictureAppearance.xlScreen);
}

.NET Framework 安全性

请参见

参考

ChartSheet 接口

Microsoft.Office.Tools.Excel 命名空间