Alpha not working on Vector graphics

Report any Hollywood bugs here
Post Reply
Bugala
Posts: 1181
Joined: Sun Feb 14, 2010 7:11 pm

Alpha not working on Vector graphics

Post 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.
Flinx
Posts: 192
Joined: Sun Feb 14, 2021 9:54 am
Location: Germany

Re: Alpha not working on Vector graphics

Post by Flinx »

I have no explanation, but a workaround:

Code: Select all

DrawPath(1, 200, 200, #RED, {Transparency=90})
plouf
Posts: 473
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

Re: Alpha not working on Vector graphics

Post 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()
Christos
Bugala
Posts: 1181
Joined: Sun Feb 14, 2010 7:11 pm

Re: Alpha not working on Vector graphics

Post 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.
Bugala
Posts: 1181
Joined: Sun Feb 14, 2010 7:11 pm

Re: Alpha not working on Vector graphics

Post by Bugala »

@Flinx, thanks for the workaround! Thought I couldnt get my program to do what I wanted, bu this solves the problem.
User avatar
airsoftsoftwair
Posts: 5446
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Alpha not working on Vector graphics

Post 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.
Post Reply