[Question] Picture

Posts 111 of 11 · Page 1 of 1
[Question] Picture
On How to draw a picture ingame, by using DX9.

I had a friend give me this, but it doesn't work for me, someone shed some light?
[PHP]void cMenu:rawImageF(LPDIRECT3DDEVICE9 pDevice, LPD3DXSPRITE sprite,LPDIRECT3DTEXTURE9 pTexture, float x, float y, float z, char* file, ...)
{

sprite = NULL;
if (!SUCCEEDED(D3DXCreateTextureFromFileA(pDevice, file, &pTexture)))
D3DXCreateTextureFromFileA(pDevice, file, &pTexture);

D3DXCreateSprite(pDevice, &sprite);
sprite->Begin(D3DXSPRITE_ALPHABLEND);
D3DXVECTOR3 pos;
pos.x= x;
pos.y= y;
pos.z= z;
sprite->Draw(pTexture, NULL, (0,0,0), &pos, D3DCOLOR_XRGB(255,255, 255));
sprite->End();
}[/PHP]
D3DX stuff D/Cs now is what I've heard. =/
Quote Originally Posted by Crash View Post
D3DX stuff D/Cs now is what I've heard. =/
/ for na, nexonfageu patched all gellins base but not hans211
Quote Originally Posted by Zoom View Post


/ for na, nexonfageu patched all gellins base but not hans211
I've got a menu hack that works fine for me but I'm not sure about other people. I don't have any of my testers online to see if it works or not so / if it works or not.
try something like this bro

this->DrawImageF(pDevice, pSprite, pTexture, 5.0f, 5.0f , 0.0f, "C:\something.jpg");
As Sealionone said I think that will be found by hackshield. Even if it isnt it will lag alot.
dont call it every frame
Quote Originally Posted by zmansquared View Post
dont call it every frame
Exactly Right.

I found a source you might like.
Credits to Revo

[php]
LPDIRECT3DTEXTURE9 Texture_Interface;
LPD3DXSPRITE Sprite_Interface;


HRESULT WINAPI BeginScene_Detour(LPDIRECT3DDEVICE9 Device_Interface)
{
static BOOL Initiate = TRUE;

if(Initiate == TRUE)
{
Initiate = FALSE;
D3DXCreateTextureFromFile(Device_Interface, "*:\\file.ext", &Texture_Interface);
D3DXCreateSprite(Device_Interface, &Sprite_Interface);
}

return BeginScene_Pointer(Device_Interface);
}


HRESULT WINAPI EndScene_Detour(LPDIRECT3DDEVICE9 Device_Interface)
{
D3DXVECTOR2 Position;

Position.x = 150.0f;
Position.y = 200.0f;

Sprite_Interface->Begin();
Sprite_Interface->Draw(Texture_Interface, NULL, NULL, NULL, NULL, &Position, 0xFFFFFFFF);
Sprite_Interface->End();

return EndScene_Pointer(Device_Interface);
}

There is also one that uses the image bytes, So there is no need for the actual file. You just need a img byte converter

Ill create a tut on it.
[/php]
Wow Zman beat me to it but that method laggs like crazy
Quote Originally Posted by coryster2100 View Post
Wow Zman beat me to it but that method laggs like crazy
Only when you create it every frame
Do it properly and it will be fine
@Ac1D_BuRn, I saw that

I tried and boom worked.

<3 Sprites :P
Posts 111 of 11 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?