July 20, 2019, 07:35:06 AM

Author Topic: ARGB  (Read 270 times)

Offline grindalf

  • Jr. Member
  • **
  • Posts: 65
ARGB
« on: April 01, 2019, 07:31:11 PM »
Ive been messing around with readpixelfast and writepixelfast but Im not sure how to alter the argb values that I get from the readpixelfast command.
in simple commands

getcolor x,y
red=colorred()
color red+10,0,0
plot x,y

How would I go about doing that with the read/write fast commands?

Offline STEVIE G

  • Sr. Member
  • ****
  • Posts: 292
Re: ARGB
« Reply #1 on: April 01, 2019, 09:32:17 PM »
Something like this ..

Code: [Select]
argb = ReadPixelFast( i,j, TextureBuffer( Texture ) )
r = ( argb And $FF0000) Shr 16
g = ( argb And $FF00 ) Shr 8 
b = ( argb And $FF ) 
a = ( argb And $FF000000 ) Shr 24
r = r + 10
argb = ( a Shl 24 ) Or ( r Shl 16 ) Or ( g Shl 8 ) Or b
WritePixelFast i , j , argb, TextureBuffer( Texture )

Offline grindalf

  • Jr. Member
  • **
  • Posts: 65
Re: ARGB
« Reply #2 on: April 01, 2019, 09:55:17 PM »
Thanks that is perfect