2017-07-08 5 views
0

Je peux dessiner une image avec un canal alpha fin, mais je ne peux pas modifier le canal alpha via le paramètre de couleur.Sprite de dessin avec canal alpha supplémentaire

Essayé ceci:

d3dImage->Begin(D3DXSPRITE_ALPHABLEND|D3DXSPRITE_SORT_DEPTH_BACKTOFRONT|D3DXSPRITE_DO_NOT_ADDREF_TEXTURE); 

J'utilise sprite pour rendre rectangle et images:

void DrawRect(float x, float y, int width, int height, DWORD color) 
{ 
    imgPosition.x = x; 
    imgPosition.y = y; 

    imgSize.left = 0; 
    imgSize.right = width; 
    imgSize.top = 0; 
    imgSize.bottom = height; 

    d3dImage->Draw(texWhite, &imgSize, NULL, &imgPosition, color); 
} 

Répondre

0

Fonctionne avec seulement des textures 8 bits.