How i can edit a selected image in brightness and contrast?
This not works
dplS = origImg.Duplicate();
dplS.ApplyEffectBCI(imgBrightness,100,100);
Look like this broke in CorelDRAW 2019. So it is broken in 2019, 2020 and 2021. Previous versions it does work. I will get it logged for you.
-Shelby
I am new to Corel Draw programming. How does something like this normally work? Will corel bring an update? And how long does something like this take.What happens if Corel in the version 2022 some things no longer supported?
From 2019 works like this...Sub TestBCI() ' Recorded 16/08/2021
Dim sr As ShapeRange Set sr = ActiveSelectionRange sr(1).Style.StringAssign "{""StackedBitmapEffects"":{""BCIEffect"":{""Brightness"":""-100"",""Contrast"":""0"",""Intensity"":""0""}}}"
End Sub
Edit:
Ok, I figured out how that can be done - basically create a style and then use this command:
Debug.Print ActiveDocument.StyleSheet.Styles.First.ToString
To see what it looks like:
{"HueSaturationLightnessEffect":{"Saturation":"<2>41<1>0<1>0<1>0<1>0<1>0<1>0<1>0","IncludeBlack":"0","Lightness":"<3>-65<1>0<1>0<1>0<1>0<1>0<1>0<1>0","Channel":"0","Hue":"<4>-128<1>0<1>0<1>0<1>0<1>0<1>0<1>0","PerceivedGrayscaleHue":"0"},"HueSaturationLightnessEffect_Z_Index":"0","HueSaturationLightnessEffect_Deleted":"0"}
Which you can then adapt to your needs like...
ActiveSelectionRange.Shapes.First.Style.StringAssign "{""StackedBitmapEffects"":{""HueSaturationLightnessEffect"":{""Saturation"":""<2>41<1>0<1>0<1>0<1>0<1>0<1>0<1>0"",""IncludeBlack"":""0"",""Lightness"":""<3>-65<1>0<1>0<1>0<1>0<1>0<1>0<1>0"",""Channel"":""0"",""Hue"":""<4>-128<1>0<1>0<1>0<1>0<1>0<1>0<1>0"",""PerceivedGrayscaleHue"":""0""},""HueSaturationLightnessEffect_Z_Index"":""0"",""HueSaturationLightnessEffect_Deleted"":""0""}}}"
But there is a big problem here - the effect is a Stacked Bitmap Effect as the name says - so everything becomes a large bitmap, everything slows down and it is not quite what you may expect if the plan is to change the settings differently for several objects.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Wow, thanks!
I have no idea how you got that to work, since in 2021 it is not recorded like that at all. For some reason it is incredibly slow, but still works on vector objects properly.
Could you please share what the HSL adjustment looks like? I tried to change just the names, but it must have something to select the color ranges as well so nothing works.
Tone curve data in VBA - CorelDRAW and Corel DESIGNER API - Developer Area - CorelDRAW Community