Question has been asked before, but I don't see any answers. I'm hoping those who asked came up with solution on their own(?). I haven't!
https://community.coreldraw.com/sdk/f/code-snippets-feedback/61736/applyeffectbci-not-working-in-macro
The following code used to work: in CorelDRAW Graphic Suite in processing photographs for laser engraving
Public Sub Photo_Wood_EpilogLaser() ' Recorded 7/25/20141 Dim OrigSelection As ShapeRange2 Set OrigSelection = ActiveSelectionRange3 OrigSelection(1).Bitmap.Resample 0, 0, True, 600#, 600#4 OrigSelection(1).ApplyEffectGamma 3.55 OrigSelection(1).Bitmap.ApplyBitmapEffect "Unsharp Mask", "UnsharpMaskEffect UnsharpMaskPerctg=_ 500,UnsharpMaskRadius=20,UnsharpMaskThreshold=6"6 OrigSelection(1).Bitmap.ApplyBitmapEffect "Sharpen", "SharpenEffect SharpenLevel=100,SharpenThreshold=_ 70,SharpenPreserveColor=1"7 OrigSelection(1).Bitmap.ConvertToBW 5, Halftone:=2, HalftoneAngle:=0, HalftoneSize:=6End Sub
I'm far from understanding all the above values; it was recorded and it worked for several versions of CGS.
Unfortunately, none of the above will record. So, I can't cheat!
line #4 (Gamma) Has *not* worked since about v18, but started working again in the brand new v24.{HooRay!}
line #7 (ConverToBW) has always worked
that means I still need help in coding #3(ReSample), #5,#7(UnSharp, Sharp)
When I say "not working," there is no error message as it passes through code, it just does nothing.
Hi Roy, I tweaked the following in 2020 and it works there:
Sub Photo_Wood_EpilogLaser()Dim OrigSelection As ShapeRangeSet OrigSelection = ActiveSelectionRangeOrigSelection(1).Bitmap.Resample 0, 0, True, 600#, 600#OrigSelection(1).ApplyEffectGamma 3.5OrigSelection(1).Bitmap.ApplyBitmapEffect "Unsharp Mask", "UnsharpMaskEffect UnsharpMaskPerctg=500,UnsharpMaskRadius=20,UnsharpMaskThreshold=6"OrigSelection(1).Bitmap.ApplyBitmapEffect "Sharpen", "SharpenEffect SharpenLevel=100,SharpenThreshold=70,SharpenPreserveColor=1"OrigSelection(1).Bitmap.ConvertToBW 5, Halftone:=2, HalftoneAngle:=0, HalftoneSize:=6End Sub
Jeff,
I greatly appreciate you taking a look at this.
Your code in CGS2022 (v.24) works for the following Resample ApplyEffectGamma ConvertToBW in CGS2022 does nothing (no error, but no effect visible) UnsharpMask Sharpen
I reinstalled CGS2020(v.22) to see if I got my versions mixed upYour code works for Resample ConvertToBWDoesn't work for: (no errors just no visible effect) ApplyEffectGamma UnSharpMask Sharpen
The last three ceased working in v.20. The ApplyEffectGamma seems to have been fixed in v.24