Peter,
I think I'm getting a little closer or seeing the same thing with a different approach. The strange thing is the alpha value is aways returned as 255 but if I use a different alpha value to set the pixel, the color R,G,B values are changed based on the alpha value I passed. Here is the Script BASIC GFX extension module gfx_GetPixelRGBA.
besFUNCTION(gfx_GetPixelRGBA)
DIM AS SDL_Surface PTR this_surface;
DIM AS Uint32 PTR pixels;
DIM AS int x, y;
DIM AS Uint8 r, g, b, a;
besARGUMENTS("iii")
AT this_surface, AT x, AT y
besARGEND
pixels = (Uint32 *)this_surface->pixels;
SDL_GetRGBA(pixels[(y * this_surface->w) + x], this_surface->format, &r, &g, &b, &a);
printf("r = %i, g = %i, b = %i, a = %i\n", r, g, b, a);
besRETURNVALUE = NULL;
besEND
IMPORT gfx.inc
s = gfx::Window(320, 240, "Pixel Test")
gfx::pixelRGBA s, 100, 100, 64, 128, 64, 255
gfx::Update
gfx::GetPixelRGBA(s, 100, 100)
WHILE gfx::KeyName(1) <> "+escape"
WEND
gfx::Close
jrs@laptop:~/sb/sb22/gfx$ scriba getpixel.sb
r = 64, g = 128, b = 64, a = 255
gfx::pixelRGBA s, 100, 100, 64, 128, 64, 0
jrs@laptop:~/sb/sb22/gfx$ scriba getpixel.sb
r = 0, g = 0, b = 0, a = 255
gfx::pixelRGBA s, 100, 100, 64, 128, 64, 100
jrs@laptop:~/sb/sb22/gfx$ scriba getpixel.sb
r = 25, g = 50, b = 25, a = 255
If I create another surface and use it to set the pixel and gfx::GetPixelRGBA, the alpha value changes as does the color values. Here are the return values using the same process as above. (alpha 255, 0, 100)
IMPORT gfx.inc
sv = gfx::Window(320, 240, "Pixel Test")
s = gfx::CreateSurface(320, 240, 32)
gfx::pixelRGBA s, 100, 100, 64, 128, 64, 100
gfx::GetPixelRGBA(s, 100, 100)
gfx::BlitSurface s, 0, sv, 0
gfx::Update
WHILE gfx::KeyName(1) <> "+escape"
WEND
gfx::Close
jrs@laptop:~/sb/sb22/gfx$ scriba getpixel.sb
r = 64, g = 128, b = 64, a = 255
jrs@laptop:~/sb/sb22/gfx$ scriba getpixel.sb
r = 0, g = 0, b = 0, a = 0
jrs@laptop:~/sb/sb22/gfx$ scriba getpixel.sb
r = 25, g = 50, b = 25, a = 39
jrs@laptop:~/sb/sb22/gfx$
I added in my standard gfx::GetPixel function and printed it as a HEX value. (using an alpha value of 100)
jrs@laptop:~/sb/sb22/gfx$ scriba getpixel.sb
r = 25, g = 50, b = 25, a = 39
19321927
jrs@laptop:~/sb/sb22/gfx$