Page 1 of 1
Alpha not working on Vector graphics
Posted: Mon Feb 05, 2024 2:12 pm
by Bugala
StartPath(1)
AddArcToPath(1, 100, 100, 50, 50, 120, 220)
DrawPath(1, 0, 0, ARGB(10, #RED))
DrawPath(1, 100, 100, ARGB(90, #RED))
DrawPath(1, 200, 200, ARGB(190, #RED))
WaitLeftMouse()
Hollywood 9.1 Windows 11 - All Arcs look exactly same colored, even to my understanding some of them should look clearly fainter.
Re: Alpha not working on Vector graphics
Posted: Tue Feb 06, 2024 2:45 pm
by Flinx
I have no explanation, but a workaround:
Code: Select all
DrawPath(1, 200, 200, #RED, {Transparency=90})
Re: Alpha not working on Vector graphics
Posted: Tue Feb 06, 2024 7:11 pm
by plouf
i think (not 100% sure) that alpha works with layers only i.e. dither alpha based on previous layer
Code: Select all
EnableLayers()
StartPath(1)
AddArcToPath(1, 100, 100, 50, 50, 120, 220)
DrawPath(1, 0, 0, ARGB(10, #RED))
DrawPath(1, 100, 100, ARGB(90, #RED))
DrawPath(1, 200, 200, ARGB(190, #RED))
WaitLeftMouse()
Re: Alpha not working on Vector graphics
Posted: Tue Feb 06, 2024 8:32 pm
by Bugala
@Andreas
Just noticed the DrawTo example code from the manual has a small problem too:
Code: Select all
SetFillStyle(#FILLNONE)
SetFormStyle(#ANTIALIAS)
x=25.6 y=128.0
x1=102.4 y1=230.4
x2=153.6 y2=25.6
x3=230.4 y3=128.0
StartPath(1)
MoveTo(1, x, y)
CurveTo(1, x1, y1, x2, y2, x3, y3)
SetLineWidth(10)
DrawPath(1, 0, 0, #BLACK)
ClearPath(1)
MoveTo(1, x, y)
LineTo(1, x1, y1)
MoveTo(1, x2, y2)
LineTo(1, x3, y3)
SetLineWidth(6)
DrawPath(1, 0, 0, ARGB(128, #RED))
WaitLeftMouse()
In addition to ARGB not working, the first CurveTo is drawn using BLACK color, which is problematic since the Background by default is BLACK too, meaning you don't see what it is doing with this example code until you first change that #BLACK color into something else.
Re: Alpha not working on Vector graphics
Posted: Tue Feb 06, 2024 8:33 pm
by Bugala
@Flinx, thanks for the workaround! Thought I couldnt get my program to do what I wanted, bu this solves the problem.
Re: Alpha not working on Vector graphics
Posted: Sun Feb 11, 2024 9:50 pm
by airsoftsoftwair
plouf wrote: ↑Tue Feb 06, 2024 7:11 pm
i think (not 100% sure) that alpha works with layers only
No, it should work. It's definitely a bug, though it only happens with layers off.
Re: Alpha not working on Vector graphics
Posted: Sat Jul 20, 2024 3:57 pm
by airsoftsoftwair
Code: Select all
- Fix: DrawPath() didn't handle the alpha component of the color that was passed to it in case layers were turned off