hxx Posted April 20, 2004 Posted April 20, 2004 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 Quote
LDV Posted April 20, 2004 Posted April 20, 2004 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 Quote
ThePentiumGuy Posted April 20, 2004 Posted April 20, 2004 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 Quote My VB.NET Game Programming Tutorial Site (GDI+, Direct3D, Tetris [coming soon], a full RPG.... you name it!) vbprogramming.8k.com My Project (Need VB.NET Programmers) http://workspaces.gotdotnet.com/ResolutionRPG
hxx Posted April 20, 2004 Author Posted April 20, 2004 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 Quote
hxx Posted April 20, 2004 Author Posted April 20, 2004 (edited) 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... Edited April 21, 2004 by hxx Quote
LDV Posted April 21, 2004 Posted April 21, 2004 Just use the Argb color. Color.FromArgb(Alpha, red, green, blue); Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.