This is an example of Generating an alpha map in DBP then adding it to an Image.
Set display mode 1280,1024,32
Hide Mouse
Color as Integer : Color=0
Radius as Integer : Radius=64
For aCircle=0 to 64
Radius=Radius-1
Ink rgb(Color,Color,Color),1
For Y=(Screen Height()/2)-64 to (Screen Height()/2)
For X=(Screen Width()/2)-64 to (Screen Width()/2)
If CircleDetection(Screen Width()/2,Screen Height()/2,Radius,X,Y) then Dot X,Y
Next X
Next y
Color=Color+4
Next aCircle
Get Image 1,(Screen Width()/2)-64,(Screen Height()/2)-64,(Screen Width()/2),(Screen Height()/2),1
Ink RGB(255,255,255),1
Print "We Have Created Our Alpha Layer, Press Any Key To Continue"
wait key
cls
Ink RGB(0,0,255),1
Box (Screen Width()/2)-64,(Screen Height()/2)-64,(Screen Width()/2),(Screen Height()/2)
Get Image 2,(Screen Width()/2)-64,(Screen Height()/2)-64,(Screen Width()/2),(Screen Height()/2),1
Ink RGB(255,255,255),1
Print "We Have Created Our Image, Press Any Key To Continue"
wait key
cls
Make Memblock from Image 1, 1
Make Memblock from Image 2, 2
Global Pixel as Integer: Pixel=12
For Y=1 to 64
For X=1 to 64
Local Color as Integer
Color=Memblock Byte(1,Pixel)
Write Memblock Byte 2, Pixel+3,Color
Pixel=Pixel+4
Next X
Next Y
Make Image From Memblock 2,2
Ink RGB(255,255,255),1
Print "We Have added Our Alpha Channel to Our Memblock, Press Any Key To Continue"
wait key
cls
Paste Image 2,(Screen Width()/2)-64,(Screen Height()/2)-64,1
Ink RGB(255,255,255),1
Print "This is our finished product, Press Any Key To End"
wait key
End
Function CircleDetection(OX as Integer, OY as Integer , ORadius as Integer ,X as Integer , Y as Integer)
Local Distance as Integer
Local Hit as Boolean : Hit=0
Distance = sqrt((OX-X)*(OX-X) + (OY-Y)*(OY-Y))
If Distance <= ORadius then Hit=1
EndFunction Hit
In theory, there is no difference between theory and practice. But, in practice, there is.