Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Badone

Pixel Scaling

This topic is 6019 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

Hi, I''m using D3DXSprite and for the scaling parameter in the draw function I just put in a D3DXVECTOR2 so it has x and y. When I do this, 1.0f would be drawing the image the way it is, is there anyway to do this using pixels? So I could specify I want the image to be 800 pixels wide and 600 pixels high? Thanks!

Share this post


Link to post
Share on other sites
Advertisement
Anyone? I was thinking, is there a way to find out the starting pixel width and height of the image? Using that I could make a function that would let me use pixels and convert them to the floats like 1.2f.

Share this post


Link to post
Share on other sites
You could write a function that figures out the percentage shrink/stretch, and then return it as a float... that way you wouldn''t have to do the dirty work every time.

Share this post


Link to post
Share on other sites
Yeah, that''s what I was thinking, but is there anyway to get the pixel width and height of the image? Thanks.

Share this post


Link to post
Share on other sites
I guess I could manually put in the width and height of the image, I was just hoping there might be a premade function in the Dxsdk that will give you with width and height of an image you specify.

Share this post


Link to post
Share on other sites

  • 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!