Ultra FastImage for Blitz3D

Blitz3D Forums/Blitz3D Userlibs/Ultra FastImage for Blitz3D

MixailV,
I'm testing some things using masked areas but I got
the same problem as when working with Blitz images and textures,

masked areas of dinamically created images/textures are not detected,

have a look at this code,
Do I have any way to make the image have the black pixels transparent ?
basically I'm using CopyRect to put the screen in one of your images but
I can't get the black pixels of the image to be masked:
Include "include\FastImage.bb"

Graphics3D 1024,768,16,2

InitDraw SystemProperty("Direct3DDevice7")


cam=CreateCamera()
	CameraRange cam,.01,200
	PositionEntity cam,0,0,-50
	
tex=CreateTexture(1024,1024,1+4+256)


;	FI_AUTOFLAGS = -1
;	FI_NONE = 0
;	FI_MIDHANDLE = 1
;	FI_FILTEREDIMAGE = 2
img=CreateImageEx(tex,1024,1024,FI_FILTEREDIMAGE)

For c=1 To 250
	cube=CreateCube()
		PositionEntity cube,Rand(-30,30),Rand(-30,30),Rand(-30,30)
		EntityFX cube,1 : TurnEntity cube,Rand(-90,90),0,Rand(-90,90)
	Select Rand(1,3)
		Case 1
			EntityColor cube,255,0,0
		Case 2
			EntityColor cube,0,255,0
		Case 3
			EntityColor cube,0,0,255
	End Select
Next


fps=CreateTimer(30)

While Not KeyDown(1)
	WaitTimer(fps)
	

	If KeyDown(200) MoveEntity cam,0,0,.2
	If KeyDown(208) MoveEntity cam,0,0,-.2
	If KeyDown(203) MoveEntity cam,-.2,0,0
	If KeyDown(205) MoveEntity cam,.2,0,0
	TurnEntity cam,MouseYSpeed()/12.0,-MouseXSpeed()/12.0,0
	RotateEntity cam,EntityPitch(cam),EntityYaw(cam),0
	MoveMouse GraphicsWidth()/2,GraphicsHeight()/2


	UpdateWorld
	RenderWorld
	
	CopyRect 0,0,GraphicsWidth(),GraphicsHeight(),0,0,BackBuffer(),TextureBuffer(tex)

	StartDraw	;________\/
	
		;	FI_SOLIDBLEND = 0
		;	FI_ALPHABLEND = 1
		;	FI_LIGHTBLEND = 2
		;	FI_SHADEBLEND = 3
		;	FI_MASKBLEND = 4
		;	FI_MASKBLEND2 = 5
		;	FI_INVALPHABLEND = 6
		SetBlend(4)
	
		SetScale(.5,.5)
		DrawImageEx(img,512,0)
	
	
	EndDraw	;________/\


	Color 255,255,255
	Rect 512,0,512,512,0
	Text 10,10,"Move with  Arrows+Mouse"

	If KeyHit(17) Then w=Not w WireFrame w
	Flip
Wend
MoveMouse 400,300:End

Function between(value#,menus#,max#)
	If value>=menus And value<=max
	Return True
	Else
	Return False
	EndIf
End Function

Function interpolate#(v#,a#,b#,c#,d#)
Return c+(((v-a)*(d-c))/(b-a))
End Function

Function ERASE_SURFACE(ele,tname$)
	tname=Lower(tname)
	For c=1 To CountSurfaces(ele)
	cbr=GetSurfaceBrush(GetSurface(ele,c))
	cbrtex=GetBrushTexture(cbr,0)
	cbrtexname$=TextureName(cbrtex) : cbrtexname=Lower(cbrtexname)
		If Len(cbrtexname)>0
			For cl=Len(cbrtexname) To 1 Step -1
			cbrtexname2$=Mid(cbrtexname,cl,1)
				If cbrtexname2="" Or cbrtexname2="/"
				Exit
				Else
				cbrtexname3$=cbrtexname3+cbrtexname2
				EndIf
			Next
		EndIf
	FreeBrush cbr
	FreeTexture cbrtex
		If cbrtexname3=tname
		ClearSurface(GetSurface(ele,c))
		Exit
		EndIf
	cbrtexname$=""
	cbrtexname2$=""
	cbrtexname3$=""
	Next
	cbrtexname$=""
	cbrtexname2$=""
	cbrtexname3$=""
End Function
;----------------------------


Paolo.