简体   繁体   English

在Excel中使用VBA设置图像透明度

[英]Set image transparency with VBA in Excel

Is there a way to apply some transparency to an image using a VBA script? 有没有办法使用VBA脚本为图像应用一些透明度? I have recorded a "macro" and it seems that artistic effects aren't recorded. 我录制了一个“宏观”,似乎没有录制艺术效果。 I have found how to make it for shapes, but not for images. 我已经找到了如何制作形状,但不是图像。

This requires several steps: 这需要几个步骤:

  1. Place an AutoShape (like a rectangle) on the worksheet 在工作表上放置一个自选图形(如矩形)
  2. Embed your actual picture in the rectangle using: .ShapeRange.Fill.UserPicture 使用以下.ShapeRange.Fill.UserPicture将实际图片嵌入矩形: .ShapeRange.Fill.UserPicture
  3. Adjust the transparency using: .ShapeRange.Fill.Transparency 使用以下.ShapeRange.Fill.Transparency调整透明度: .ShapeRange.Fill.Transparency

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM