💯 我们可以自己使用 VBA 写个插件,来调用这个程序,在 CorelDRAW 中一键使用,达到美白的效果
cleanLight.exe
程序和 opencv_world4100.dll
参考下面源码,放到 c:/app/ 目录
Sub 蘭雅一键美白()
UserForm1.Show 0
End Sub
Sub Call_CleanLight()
Dim path As String, exePath As String, cmd As String, Color As String, img As String
path = "c:/app/lyapp.jpg"
new_image = "c:/app/lyapp.png"
Dim s As Shape, d As Document
Set s = ActiveShape
Set d = ActiveDocument
Color = cdrGrayscaleImage
Dim opt As New StructExportOptions
opt.ResolutionX = s.Bitmap.ResolutionX
opt.ResolutionY = s.Bitmap.ResolutionY
opt.ImageType = Color
d.Export path, cdrJPEG, cdrSelection, opt
exePath = "c:/app/cleanLight.exe"
cmd = exePath & " " & path & " " & new_image
Shell cmd, vbHidevb ' NormalFocus
MsgBox "蘭雅一键美白GMS调用,请先点击美白程序对话框"
new_image = "c:/app/lyapp.png"
ActiveDocument.ClearSelection
ActiveLayer.Import new_image
Set sc = ActiveSelection
Dim x As Double, y As Double
s.GetPosition x, y
sc.SetPosition x, y
s.GetSize x, y
sc.SetSize x, y
s.Delete
End Sub
自己新建一个 GMS 插件,添加如上源码,就可以愉快的学习了
🐟️ CorelDRAW GMS调用 蘭雅文稿一键美白App