Jump to content

Recommended Posts

Posted

http://www.autoitscript.com/autoit3/docs/libfunctions/_ColorGetRGB.htm

#include <Color.au3>

_ColorGetRGB($nColor)

Success: an array of values in the range 0-255:

[0] Red component color

[1] Green component color

[2] Blue component color

Failure: set @error to 1

its actually BRG, not RGB

[0] Blue component color

[1] Green component color

[2] Red component color

here is how I have been making use of it:

$bgr = _ColorGetRGB("0x00"&Hex(_PixelGetColor_GetPixelRaw($vDC, $x, $y, $hDll),6))

Posted

If that is the case (I haven't checked) then this isn't a documentation error, because changing the return values would result in the function having to be renamed. I will now check.

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Posted

Looks fine to me from the help file example.

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

  • Moderators
Posted

guinness,

And to me too: :)

#include <Color.au3>
$aRet = _ColorGetRGB(0xFF8000)
MsgBox(0, "Return", "Red: " & Hex($aRet[0], 2) & @CRLF & _
                    "Grn: " & Hex($aRet[1], 2) & @CRLF & _
                    "Blu: " & Hex($aRet[2], 2))

xekon,

Where does this _PixelGetColor_GetPixelRaw function come from? It is undoubtly that which is returning values which are confusing _ColorGetRGB. ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

  Reveal hidden contents

 

Posted

ahhh you are correct, it is because of the UDF it seems. (I use it cause it makes PixelGetcolor roughly 1,000 times faster when working on a large number of pixels like 100x100)

_PixelGetColor.au3

_PixelGetColor_GetPixelRaw

I should have investigated this farther.

Posted

Hey Thanks for that trancexx

"Out of curiosity, why do you have "0x00" and Hex() thingy?"

I have now simplified it to

$bgr = _ColorGetRGB(_PixelGetColor_GetPixelRaw($vDC, $x, $y, $hDll),6)

both ways give the same result, but this is less code :)

Posted

  On 1/31/2013 at 9:08 PM, 'xekon said:

I should have investigated this farther.

It's always best to triple check when situations arise like this.

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...