Jump to content
  • Advertisement


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


bitmap scaling .....help!!

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

ok basicly like that topic says i''m trying to scale a bitmap to make it bigger or smaller but well i don''t know how i''v looked on the net and found some docs but they didn''t really make ay sense so i''m hoping some one could explain it in easy to understand terms with or without code cause once i under stand it i''m sure i can write something up thx for any help

Share this post

Link to post
Share on other sites
The easist method is to use a little algorithm like this:

for DestY := 0 to ImageHeight do
for DestX := 0 to ImageWidth do
{calculate the source pixels based on the scale and our current destination pixel}

{if the source pixel coordinate is within the source image...}
if (SrcX > 0) and (SrcX < ImageWidth) and
(SrcY > 0) and (SrcY < ImageHeight) then
{...copy this source pixel into the destination}

That will go through the pixels in the destination image, selecting which pixel to copy from the source.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!