通过编码将图像粘贴到图表变得模糊

问题描述 投票:1回答:1

在图表上粘贴图像时遇到问题。

这是我的代码的剪切样本

ws.Paste
Set MyChart = wb.Charts.Add
MyChart.Name = "ImageChart"
Set MyChart = MyChart.Location(Where:=xlLocationAsObject, Name:=ws.Name)
MyChart.ChartArea.Width = ws.Shapes(1).Width
MyChart.ChartArea.Height = ws.Shapes(1).Height
MyChart.Parent.Border.LineStyle = 0 
ws.Shapes(1).CopyPicture xlScreen, xlPicture
MyChart.ChartArea.Select
MyChart.Paste

我正在调整图表的高度和宽度,使其与图像相同,粘贴时,它会变得模糊。但是当我手动操作时,图像的质量保持不变。

vba excel-vba excel
1个回答
1
投票

您需要将图片复制为高分辨率元文件...

将第一个参数更改为CopyPicturexlPrinter

© www.soinside.com 2019 - 2024. All rights reserved.