ChartSheet.CopyPicture 方法
将 Microsoft.Office.Tools.Excel.ChartSheet 作为图片复制到剪贴板。
命名空间: Microsoft.Office.Tools.Excel
程序集: Microsoft.Office.Tools.Excel.v4.0.Utilities(在 Microsoft.Office.Tools.Excel.v4.0.Utilities.dll 中)
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
)
参数
- Appearance
类型:Microsoft.Office.Interop.Excel.XlPictureAppearance
指定复制图片的方法。
- Format
类型:Microsoft.Office.Interop.Excel.XlCopyPictureFormat
该图片的格式。
- Size
类型:Microsoft.Office.Interop.Excel.XlPictureAppearance
对象为图表工作表上的图表(未嵌入在工作表上)上时复制的图片的大小。
备注
可选参数
有关可选参数的信息,请参见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 安全性
- 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关更多信息,请参见通过部分受信任的代码使用库。