Notifications
Clear all

[Closed] can not draw alpha color?


GC()
FreeSceneBitmaps()
UnDisplay theCanvas
CanvasWidth = 160
CanvasHeight = 120
theCanvas = bitmap CanvasWidth CanvasHeight color:white
procCanvas = copy theCanvas
Display theCanvas

for PosY = 0.0 to CanvasHeight - 1 do
	for PosX = 0.0 to CanvasWidth - 1 do
	(
		R = (PosX / CanvasWidth) * 255
		G = (PosY / CanvasHeight) * 255
		B = 100
		A = 10
		SetPixels procCanvas [PosX,PosY] #((color  R G B A))
	)


Display theCanvas


thanks

3 Replies

You need to display the bitmap you’ve drawn too…

Display procCanvas

thnaks for your reply
but

GC()
FreeSceneBitmaps()
UnDisplay theCanvas
CanvasWidth = 160
CanvasHeight = 120
theCanvas = bitmap CanvasWidth CanvasHeight color:white
procCanvas = copy theCanvas
Display theCanvas

for PosY = 0.0 to CanvasHeight – 1 do
for PosX = 0.0 to CanvasWidth – 1 do
(
R = (PosX / CanvasWidth) * 255
G = (PosY / CanvasHeight) * 255
B = 100
A = 0
– a==0 or a==255, No difference
SetPixels procCanvas [PosX,PosY] #((color R G B A))
)

Display procCanvas

oh,i know ,no difference when Look in Max