Oxygen Basic
Programming => Example Code => Topic started by: Aaron on March 19, 2014, 02:06:56 PM
-
Hi,
It isn't possible to get an Alpha value.
In internal pixel array is no alpha stored, only R, G, B.
No matter, who needs an alpha ( Romeo Giulietta).
A test here:
include "ss.inc"
Openwindow 320,240,1
byte r=1,g=1,b=1,a=1
For x=0, 319
For y=0, 239
Color Rnd(64,255),Rnd(64,255),Rnd(64,255),225
SetPixel x,y
Next
Next
pixel = GetPixel 160,120
r = GetR(pixel)
g = GetG(pixel)
b = GetB(pixel)
a = GetA(pixel)
color r, g, b, 255
Fillcircle 120, 80,40
pixel = GetPixel 220,200
r = GetR(pixel)
g = GetG(pixel)
b = GetB(pixel)
a = GetA(pixel)
color r, g, b, 255
FillRect 100,140,40,40
color 255,255,255,255
DrawString 0,0, r " " g " " b " " a
waitkey
closewindow
-
It seems the alpha value is only needed on pixel creation. It's a part of the color creation internal SDL function. All we are seeing is the results of that color (alpha) translation. Knowing what the original values are doesn't seem possible. So much for sampling pixels as map position indicators.
-
Hi John,
May be I have to look a bit deeper into the matter.
-
Great!
Looking forward to what you come up with.
Making your SDL source available would also be a big help.