裁剪图像大图像的大小 >200 kb在 VBA 中不正确

问题描述

我为这个问题搜索了很多次,但没有得到正确的答案。我想按照我想要的条件裁剪图像的 x、y、右、底部(我在绘图软件中打开它并获得我想要的 x、y、宽度、高度。)我按照 x、y、右裁剪它,底部然后它正确裁剪但是当我裁剪大图像(大小图像> 200 kb)时遇到问题。它裁剪不正确。我不知道为什么它会出错。 任何人都可以帮我解决它。太感谢了 ! 这是我的代码

Dim sh as shape
Dim shpCrop As Shape
Dim sngMemoLeft As Double
Dim sngMemoTop As Double
Dim crLeft As Double
Dim crTop As Double
Dim crBottom As Double
Dim crRight As Double

Set sh = ActiveSheet.Shapes.AddPicture _
        fileName:=strPathFileImg,_
        linktofile:=msoFalse,savewithdocument:=msoCTrue,_
        left:=65,top:=50,width:=1300,height:=755

crLeft = (x_Crop ) * 0.75
crTop = (y_Crop ) * 0.75
crBottom = (bottom_Crop ) * 0.75
crRight = (right_Crop ) * 0.75

'Trim img
Set shpCrop = ActiveSheet.Shapes(sh.name)
With shpCrop
    sngMemoLeft = .left
    sngMemoTop = .top
    With .PictureFormat
        .CropLeft = crLeft
        .CropTop = crTop
        .CropBottom = crBottom
        .CropRight = crRight
    End With
    .left = sngMemoLeft
    .top = sngMemoTop
End With

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)