What's the difference between Maskblend and Alphablend with setalpha 1.0?
Doing the latter means you can alpha an image simply by changing the setalpha back and forward rather than switching maskblend and seems a bit quicker.
Not entirely sure about my test so if anybody can see a problem please let me know...
There are a couple of differences.
The alpha'd image show a few more pixels than the masked image.
On this machine, the maskalpha TESTTWO doesn't show the image as alpha'd.
Finally, if I run JUST TESTTWO it has different debuglog results than running both TESTONE and TESTTWO.
Hope that all makes sense
Doing the latter means you can alpha an image simply by changing the setalpha back and forward rather than switching maskblend and seems a bit quicker.
Not entirely sure about my test so if anybody can see a problem please let me know...
'SetGraphicsDriver GLMax2DDriver() Graphics 800,600,0 image:TImage=LoadImage("max.png") 'TESTONE SetClsColor 255,0,0 Cls SetBlend maskblend start_mask=MilliSecs() For x = 0 To 100 DrawImage image,0,0 Flip Next end_mask=MilliSecs() Cls SetBlend alphablend start_alpha=MilliSecs() For x = 0 To 100 DrawImage image,0,0 Flip Next end_alpha=MilliSecs() DebugLog (end_mask-start_mask) + " " + (end_alpha-start_alpha) 'TESTTWO Cls start_maskalpha=MilliSecs() For x = 0 To 100 SetBlend maskblend DrawImage image,0,0 SetAlpha ALPHABLEND SetAlpha 0.5 DrawImage image,200,0 Flip Next end_maskalpha=MilliSecs() Cls start_alphaalpha=MilliSecs() For x = 0 To 100 SetBlend alphablend DrawImage image,0,0 SetAlpha 0.5 DrawImage image,200,0 Flip Next end_alphaalpha=MilliSecs() DebugLog (end_maskalpha-start_maskalpha) + " " + (end_alphaalpha-start_alphaalpha)
There are a couple of differences.
The alpha'd image show a few more pixels than the masked image.
On this machine, the maskalpha TESTTWO doesn't show the image as alpha'd.
Finally, if I run JUST TESTTWO it has different debuglog results than running both TESTONE and TESTTWO.
Hope that all makes sense