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 bugged?

Author
Message
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 1st Sep 2010 21:55
Hi all

Well, why does save image always save to a resolution of 128x256, even though the image size is 640x480? Is this a bug? How can I fix this?

TheComet

HowDo
23
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 1st Sep 2010 22:14
well it would have been nice to have some code to play with to see how your are doing it.

Dark Physics makes any hot drink go cold.
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 1st Sep 2010 23:02
Of course you can have some code Sorry I forgot about that

This creates a 640x480 image, but saves it to a 1024,512... Why is that?



TheComet

Sven B
21
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 1st Sep 2010 23:04
Try changing
get image 1,0,0,640,480
to
get image 1, 0, 0, 640, 480, 1

Cheers!
Sven B

TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 1st Sep 2010 23:09
Aaaah, thank you so much Sven B It worked perfectly! Why is it that I trip over the simplest problems?

TheComet

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 1st Sep 2010 23:11
Quote: "This creates a 640x480 image, but saves it to a 1024,512... Why is that?"


That's very different from 128x256 which is what you said earlier. You'd have got the right answer straightaway if you'd got that detail right at the beginning.

Sven B has given you the answer.
Sven B
21
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 1st Sep 2010 23:26 Edited at: 1st Sep 2010 23:27
Quote: "128x256"


Just being a power of 2 was enough for me to trigger my suspicion of get image though... I didn't read his second post.
Still, Green Gandalf is right. You might want to go into more detail for faster reply with a solution.

Cheers!
Sven

TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 2nd Sep 2010 08:39
Yeah, I got some things mixed up... This is what I found out:

With a 80x60 image, it saved to a 128x64
With a 160x120 image, it saved to a 256x128
With a 320x240 image, it saved to a 512x256
With a 640x480 image, it saved to a 1024x512

Very strange... It seems it takes the largest axis, and finds the next greater axis that is an exponent of 2, where the y axis is always half of the x axis, but both axises are greater than the image dimensions.

But it works now thanks to a simple flag

TheComet

Sven B
21
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 2nd Sep 2010 15:25
Quote: "Very strange... It seems it takes the largest axis, and finds the next greater axis that is an exponent of 2, where the y axis is always half of the x axis, but both axises are greater than the image dimensions."


Actually, it just scales each dimension up to the first power of 2.

Sven B

Alien Menace
AGK Developer
21
Years of Service
User Offline
Joined: 11th Jan 2005
Location: Earth (just visiting)
Posted: 10th Sep 2010 17:55
You fix it by setting the texture flag to 1 but does anybody know why it does this to begin with? What logic would be behind that kind of default behavior?

Intel Core Duo2 E6850 3.0 GHz - 2x Geforce 8800 GTS SLI - 6GB RAM - Creative X-FI - Windows 7 64-bit.
Sven B
21
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 10th Sep 2010 18:04
Hi Alien,

Some hardware requires images whose dimensions are a power of 2. So it's hardware-related.

Cheers!
Sven B

Login to post a reply

Server time is: 2026-07-22 11:01:34
Your offset time is: 2026-07-22 11:01:34