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.

AppGameKit Classic Chat / Getting LoadImage() file dimensions?

Author
Message
Kevin Cross
21
Years of Service
User Offline
Joined: 15th Nov 2003
Location: London, UK
Posted: 26th Feb 2019 19:39 Edited at: 26th Feb 2019 19:40
Is it possible to get the image dimensions of an image loaded with LoadImage? When you apply it to a sprite the sprite is square so it's not possible to tell if it's a profile, landscape, or square image. I'm in the process of creating a pan and scale your profile pic you see in apps like Twitter and WhatsApp to add to my app and to the OryUI framework. It's working ok but it would be good if I can get access to the height and width of the image before it's applied to a sprite because as mentioned applying it to a sprite makes the sprite square. It doesn't distort the image, but when you get the sprite height and width both sizes are the same, even the image is clearly landscape.

Would it be done using Memblocks?

I've attached a screenshot of what I'm trying to create. The middle image of the 3

OryUI - A WIP AGK2 UI Framework

Attachments

Login to view attachments
puzzler2018
User Banned
Posted: 26th Feb 2019 19:42
Try



Tier 1 Developer
Ortu
DBPro Master
17
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 26th Feb 2019 19:45
tImg = loadImage(image.jpg)
tHeight = GetImageHeight(tImg)
tWidth = GetImageWidth(tImg)
Create Sprite and apply image here...
http://games.joshkirklin.com/sulium

A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.
Kevin Cross
21
Years of Service
User Offline
Joined: 15th Nov 2003
Location: London, UK
Posted: 26th Feb 2019 19:47
Oh my gawd. That's embarrassing. Thank you @Ortu
OryUI - A WIP AGK2 UI Framework
Kevin Cross
21
Years of Service
User Offline
Joined: 15th Nov 2003
Location: London, UK
Posted: 26th Feb 2019 19:50
And thank you @puzzler. Didn't see your message. The GetImageHeight and GetImageWidth works well. Don't know how I missed those.
OryUI - A WIP AGK2 UI Framework
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 26th Feb 2019 21:52
Yeah there's no need for memblocks to get an image width and height the built in commands should work fine.

Login to post a reply

Server time is: 2024-11-23 04:54:32
Your offset time is: 2024-11-23 04:54:32