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 Professional Discussion / Save Image results in 256x256 only - help resizing

Author
Message
mullinator
19
Years of Service
User Offline
Joined: 5th Jul 2007
Location:
Posted: 9th Apr 2012 07:28
I'm trying to save an image as a 236x236 jpeg. Unfortunately, the "save image" function only seems to want to save to 256x256. I've tried changing my target size, but it always saves to 256x256.

I can tell you that the image size is correct on the very line of code before it actually gets saved (this prints whatever the target size is), so I'm not sure what to make of it.



Any and all help is appreciated, thank you!
Benjamin
23
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 9th Apr 2012 08:15
Add a '1' to the end of the SAVE IMAGE command.



Support a charitable indie game project!
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 9th Apr 2012 12:22 Edited at: 9th Apr 2012 13:18
How would that help?

The following works fine for me:



There is a problem though with image scaling and the save image command in some cases so perhaps we need to see more code.

Edit My guess is that mullinator has stumbled into the DBPro image scaling bug. The following code reproduces the symptoms reported:



Things work as expected if you use my first snippet. This particular bug was included in the "Most annoying bugs" collection.
mullinator
19
Years of Service
User Offline
Joined: 5th Jul 2007
Location:
Posted: 9th Apr 2012 23:24
Thank you for the responses!
Setting a texture flag fixed the issue.

Thanks again, happy coding.
Benjamin
23
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 9th Apr 2012 23:49
Quote: "How would that help?"


Sorry, for some reason I thought SAVE IMAGE had a texture flag, but upon closer inspection it's the compression mode.



Support a charitable indie game project!
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 10th Apr 2012 01:19
You were probably thinking of the texture flag on the get image command.

Login to post a reply

Server time is: 2026-07-09 20:55:35
Your offset time is: 2026-07-09 20:55:35