i create the backbuffer and the surface:
Code:
//creating a backbuffer surface for get the sprite:        LPDIRECT3DSURFACE9 surface;
        LPDIRECT3DSURFACE9 backbuffer;
        hResult=d3ddev->GetBackBuffer( 0,0,D3DBACKBUFFER_TYPE_MONO,&backbuffer);
        hResult=d3ddev->CreateOffscreenPlainSurface(58,80,D3DFMT_X8R8G8B8,D3DPOOL_DEFAULT,&surface,NULL);
now i'm loading the image:
Code:
//Getting the sprite:        //hResult=D3DXLoadSurfaceFromResource(surface,NULL,NULL, GetModuleHandle(NULL),MAKEINTRESOURCE(ResourceID),NULL,D3DX_DEFAULT,0,NULL);
        hResult= D3DXLoadSurfaceFromFile( surface,NULL,NULL,"C:\\Users\\Cambalinho\\Documents\\CB\\testdx\\Bleu Battle.bmp",NULL,D3DX_DEFAULT,D3DCOLOR_XRGB(255,255,255),NULL );
        if ( FAILED( hResult ) ) MessageBox(NULL,"Error","erro",MB_OK);
now i draw the image:
Code:
RECT imRect={100,50,158,130};//destination rect         d3ddev->SetRenderState(D3DRS_ALPHABLENDENABLE, true);
        d3ddev->StretchRect(surface,NULL,backbuffer,&imRect, D3DTEXF_NONE);
but the surface isn't transparent. how can i make the surface transparent? or the real problem is the StretchRect() function?