Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Scaling an image down

Author
Message
KNau
21
Years of Service
User Offline
Joined: 25th Nov 2002
Location: Canada
Posted: 26th Nov 2002 12:09
I am working on a game in which players can use their own images as part of a puzzle. I will have to either enlarge or shrink their images to make them usable for my purposes in the game.

Scaling an image up isn't a problem using the COPY BITMAP command but the help files specifically state that you can't copy to a smaller bitmap size (thus shrinking the image) only a same size or larger one.

For example if the player provided a 400 x 400 bitmap and I need to shrink it to 250 x 250. How could I do this at the start of the program and have the user not see the process?

I need the scaling process the be invisible to the player and I need pixel-perfect sizing so I don't think I can use the SPRITE commands.

Any ideas? Thanks in advance for any advice or help you can provide!
John H
Retired Moderator
21
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 26th Nov 2002 13:38
Make the bitmap a sprite then scale that.

RPGamer

Current - RPG: Eternal Destiny : Help Wanted!
Upcoming- MMOFPS- Paintball Game: HELP WANTED!
Http://halbrosproductions.netfirms.com
KNau
21
Years of Service
User Offline
Joined: 25th Nov 2002
Location: Canada
Posted: 26th Nov 2002 15:09
Like I said, as far as I can tell (I've tried) the sprite commands are no good.

I need to capture the image at it's new scaled image and use it as a texture. The only way I can capture the scaled sprite is if I do it from bitmap 0 since sprites can't be drawn to any other bitmap. Then the player would be able to see the scale operation in progress which isn't something I want.

KNau
21
Years of Service
User Offline
Joined: 25th Nov 2002
Location: Canada
Posted: 26th Nov 2002 15:24
Actually, scratch that!

I finally got it working using the sprite commands - I had to use PASTE SPRITE in order to be able to capture it as an image at the new size.

Thanks for your help!

Login to post a reply

Server time is: 2024-03-28 14:30:28
Your offset time is: 2024-03-28 14:30:28