RGB and video settings question

Blitz3D Forums/Blitz3D Programming/RGB and video settings question

semar(Posted 2005) [#1]
All,

consider this piece of code:
img = createimage(32,32)
setbuffer imagebuffer(img)
clscolor 255,255,255
cls
saveimage (img, "test.bmp")


What it does, it creates an image 32X32 pixels, draws a white background on it, and then save it.

Then I open the image with PSP7, and I was really surprised to find out that the white color was not really white - I mean, not 255,255,255 for RGB, but something very near to it.

Then, I've seen that my PC video card settings were set to 16 bit colour; changing it to 32, has solved the problem.

Question: is there any way to avoid this issue ? I mean, PSP7 is capable of writing a real white color, and read it correctly, withouth having to set the video settings.

Why I can't if I use B3D? I've also tryed with BlitzPlus - same story. And I've also tryed with all the Graphics video setting resolution flags (I mean the third parameter).

What is wrong ?

Any comment ?

Sergio.


Danny(Posted 2005) [#2]
Yes, I've had trouble with that as well in the past...
It also occures (whilst in 16bit mode) when you want to read rgb values from an image. Pretty crap if you need to read exact rgb values regardless of what you're display can handle...

For similar reasons they later in Blitz included a flag '512' when loading/creating a texture to 'Force the use of high color textures'.

Perhaps you can create a texture instead, and save that as an image. Not sure if that'll work/solve your problem, never tried it...

Hope this makes sense/helps.
Danny.


semar(Posted 2005) [#3]
Thank you Danny,

I'll try the texture flag trick for sure !

Anyway, would be nice not to have to make use of workarounds.. :-/

Sergio.