I've done a bit with DX :
Strict
Graphics 800,600,0
Local image1:TImage = LoadImage("grass.png")
Local image2:TImage=LoadImage("blending.png")
SetClsColor 255,0,0
While Not AppTerminate() And Not KeyHit(key_escape)
Cls
SetBlend MASKblend
If MouseHit(1) renderit(image1,image2)
setmodnormal()
SetAlpha 1.0
DrawImage image1,MouseX(),MouseY()
Flip
Wend
Function renderit(r_image1:TImage , r_image2:TImage)
Local frame1:TD3D7ImageFrame=TD3D7ImageFrame(r_image1.frame(0))
Local frame2:TD3D7ImageFrame=TD3D7ImageFrame(r_image2.frame(0))
' If TD3D7Max2DDriver(D3D7Max2DDriver.SetActiveFrame(frame1))
D3D7GraphicsDriver().Direct3DDevice7().SetTexture 0,frame1.surface
D3D7GraphicsDriver().Direct3DDevice7().SetTextureStageState( 0, D3DTSS_COLORARG1, D3DTA_TEXTURE );
D3D7GraphicsDriver().Direct3DDevice7().SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1);
D3D7GraphicsDriver().Direct3DDevice7().SetTextureStageState( 0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE);
D3D7GraphicsDriver().Direct3DDevice7().SetTextureStageState( 0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1 );
D3D7GraphicsDriver().Direct3DDevice7().SetTexture 1 , frame2.surface
D3D7GraphicsDriver().Direct3DDevice7().SetTextureStageState( 1, D3DTSS_COLORARG1, D3DTA_TEXTURE);
D3D7GraphicsDriver().Direct3DDevice7().SetTextureStageState( 1, D3DTSS_COLOROP, D3DTOP_SELECTARG2);
D3D7GraphicsDriver().Direct3DDevice7().SetTextureStageState( 1, D3DTSS_COLORARG2, D3DTA_CURRENT);
D3D7GraphicsDriver().Direct3DDevice7().SetTextureStageState( 1, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1 );
D3D7GraphicsDriver().Direct3DDevice7().SetTextureStageState( 1 , D3DTSS_ALPHAARG1 , D3DTA_TEXTURE ) ;
' EndIf
End Function
Function setmodnormal()
D3D7GraphicsDriver().Direct3DDevice7().SetTextureStageState(0,D3DTSS_COLOROP,D3DTOP_MODULATE)
D3D7GraphicsDriver().Direct3DDevice7().SetRenderState D3DRS_ALPHATESTENABLE,True
D3D7GraphicsDriver().Direct3DDevice7().SetRenderState D3DRS_ALPHABLENDENABLE,False
End Function
<edit> Depending on your machines (or target) multitexture capability you either use another texturestage to mix with another texture (singlepass multitexture) or create a new pass and use the output as input (multipass multitexture).
<edit2> I have some better examples but they all broke when DX driver was changed and I haven't got time to fix them.