Jump to content
  • Advertisement
Sign in to follow this  
BloodLust666

Image scaling

This topic is 4736 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
I have an image that's 256x256. I want to be able to scale it to what ever size i want and draw it with the ID3DXSprite::Draw() function, how would i do that?

Share this post


Link to post
Share on other sites
i can't use that b/c i have the updated version of DirectX 9. My function is
hresult ID3DXSprite::Draw(LPDIRECT3DTEXTURE9 pTexture,
CONST RECT *pSrcRect,
CONST D3DXVECTOR3 *pCenter,
CONST D3DXVECTOR3 *pPosition,
D3DCOLOR Color
);

i can't rotate it using that

Share this post


Link to post
Share on other sites
I believe you use the matrix transformation functions provided by D3DX then set the transformation.

Share this post


Link to post
Share on other sites
EvilKnuckles666,

The ID3DXSprite interface has a method called SetTransform. The prototype looks like this:

HRESULT SetTransform( CONST D3DXMATRIX *pTransform );

From the DirectX C++ documentation

pTransform - [in] Pointer to a D3DXMATRIX that contains a transform of the sprite from the original world space. Use this transform to scale, rotate, or transform the sprite.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!