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.

Newcomers DBPro Corner / command to return imafe size

Author
Message
DavyBT
15
Years of Service
User Offline
Joined: 21st Mar 2009
Location:
Posted: 25th Mar 2009 14:29
Hi Guys,

Can anyone tell me if there's a command in darkbasic that will return the pixle size of a loaded image.

I want to calculate where to place it on the screen, I know I can just calculate the pixels position manually but it would be nice not to have to worry about png size and just let DB do the work.

Thanks.
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 25th Mar 2009 17:28 Edited at: 25th Mar 2009 17:28
Nowadays there are actually two commands named get image width respective get image height. In the good old times you would have to work around that by making a memblock out of the image and read its two first dword values, or possibly make a sprite out of the image and check that ones dimensions.

Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 26th Mar 2009 16:35 Edited at: 26th Mar 2009 16:36
Quote: "Nowadays there are actually two commands named get image width respective get image height."


I believe those are just Image Width and Image Height, minusing the "get".

<---Spell casting battle game!
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 26th Mar 2009 18:12
Maybe it is, I haven't actually got around to use them frequently myself yet.

Login to post a reply

Server time is: 2024-11-24 11:52:22
Your offset time is: 2024-11-24 11:52:22