Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bitwise NOT, is this getting "opposite" colors???
#4
Note: the array might be too big. I tried to use a string as was suggested in the Wiki but failed, increased it as much as 16 million. :O
The first time "XOR" is used, it's on black so it's just the same as "PSET".
The other time, a totally-white opaque block is drawn before the buffer overlays it, getting the same results as your rectangle.

Code: (Select All)
screen _newimage(600,400,32)

dim as _unsigned _byte r,g,b,r2,g2,b2
dim blk(1 to 400, 1 to 400) as long

again:
r = int(rnd*256)
g = int(rnd*256)
b = int(rnd*256)

r2 = not r
g2 = not g
b2 = not b

line (0, 0)-step(200, 200),_rgb32(r,g,b),BF
get (0, 0)-(199, 199), blk
line (300, 200)-step(200, 200),_rgb32(r2,g2,b2),BF
put (0, 200), blk, XOR
line(300, 0)-step(199, 199), _rgb32(255, 255, 255, 255), BF
put (300, 0), blk, XOR
end
Reply


Messages In This Thread
RE: Bitwise NOT, is this getting "opposite" colors??? - by mnrvovrfc - 11-19-2022, 04:42 AM



Users browsing this thread: 1 Guest(s)