追求新生活 名字2008

活着的意义

在office文档中,如何批处理调整图片的亮度对比度?录制宏,编辑宏,运行

在office文档中,如何批处理调整图片的亮度对比度?   方法:录制宏,编辑宏,运行

Sub 宏1()

For i = 1 To ActiveDocument.InlineShapes.Count

ActiveDocument.InlineShapes(i).PictureFormat.Brightness = 0.55 '将嵌入型图片的亮度设置为增加10%,50对应为0,55则为原来的110%
ActiveDocument.InlineShapes(i).PictureFormat.Contrast = 0.45   ‘将嵌入型图片的对比度设置为减少10%,50对应为0,45则为原来的90%


1 '将嵌入型图片的对比度设置为100

Next i
For i = 1 To ActiveDocument.Shapes.Count
If ActiveDocument.Shapes(i).Type = msoPicture Then '判断浮动型图片
ActiveDocument.Shapes(i).PictureFormat.Brightness = 0.5 '将浮动型图片的亮度设置为50,就是没有增加减少
ActiveDocument.Shapes(i).PictureFormat.Contrast = 1# '将浮动型图片的对比度设置为100,就是增加到原来的200%


End If
Next i
MsgBox "处理完毕!"

End Sub

posted on 2022-09-06 14:52  pyman  阅读(521)  评论(0编辑  收藏  举报

导航