2d texture with transparancy color

hxx

Newcomer
Joined
Mar 9, 2004
Messages
11
I draw a square,and draw texture in the square,how to set the color I wantn't draw in the texture?
please excuse my english,
if necessary ,could you show a short code?
thanks
 
hxx said:
I draw a square,and draw texture in the square,how to set the color I wantn't draw in the texture?
please excuse my english,
if necessary ,could you show a short code?
thanks

Do you work With DirecX3D ?
How do you draw the Square?
Where do you want to have the AlphaBlend - Transperency?

LDV
 
Dev.RenderState.AlphaSourceBlend = Blend.SourceAlpha
Dev.RenderState.AlphaDestinationBlend = Blend.InvSourceAlpha
DEv.RenderState.AlphaBlendEnable = True
in your render sub,

and then when loading your texture,

text = new texture(yourbitmap, width,height...,transparent color [see Intellisense])

sorry i dont remember of the top of my head
does that help,
pent?

edit:
does that help?
pent,

:p
 
LDV said:
Do you work With DirecX3D ?
How do you draw the Square?
Where do you want to have the AlphaBlend - Transperency?

LDV

yes,exactly I don't draw the squre,just set four point for (D3SFVF_XYZRHW\DIFFUSE|TEX1) to load a texture
I draw the texture use (DrawPrimitive) ,I don't know how to set transperency
 
ThePentiumGuy said:
Dev.RenderState.AlphaSourceBlend = Blend.SourceAlpha
Dev.RenderState.AlphaDestinationBlend = Blend.InvSourceAlpha
DEv.RenderState.AlphaBlendEnable = True
in your render sub,

and then when loading your texture,

text = new texture(yourbitmap, width,height...,transparent color [see Intellisense])

thanks ,I will try,
but can this "text = new texture(yourbitmap, width,height...,transparent color [see Intellisense])"
work?
what's the "texture",a class?
use vc...
 
Last edited:
Back
Top