Code archives/Graphics/Transparent Background

This code has been declared by its author to be Public Domain code.

Download source code

Transparent Background by pexe2005
It's a little slow.. But makes a nice effect.. recommended for your game GUI..

Transparent its not the correct way to call this.. because it works like a sieve.. just writing pixels each 4..
Function TransparentBackground(Start_x%,Start_y%,Width%,Height%,Color_R% = 255,Color_G% = 255,Color_B% = 255)
End_y = Start_y%+Height%
End_x = Start_x%+Width%
WP_Color = (Color_B% Or (Color_G% Shl 8) Or (Color_R% Shl 16) Or ($ff000000))
LockBuffer
For y = Start_y% To End_y-1
	a = Abs(a-1)
	For x = Start_x%+(a*2) To End_x-1 Step 4
		WritePixelFast x,y,WP_Color
	Next
Next
UnlockBuffer
End Function

Comments

None.

Code Archives Forum