Jump to content

PixelGetColor Problem


torels
 Share

Recommended Posts

Hi there

Does anybody know why if I use pixelGetColor on blue pixels (any variation of blue) the returned value is a red Color and viceversa ?

thanks in advance

Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org

Link to comment
Share on other sites

Hi there

Does anybody know why if I use pixelGetColor on blue pixels (any variation of blue) the returned value is a red Color and viceversa ?

thanks in advance

AutoItSetOption( "ColorMode" , 0 )

;0 = Colors are defined as RGB (0xRRGGBB) (default)

;1 = Colors are defined as BGR (0xBBGGRR) (the mode used in older versions of AutoIt)

;2008-07-02(Wed) - AutoIt v3 removed this OPT.

Most of your problem, showed in AutoIt Help :-)

Link to comment
Share on other sites

and how do I solve the problem considering that ColorMode opt doesn't exist anymore ?

I tried swapping blue and red but I get an inverted color then...

Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org

Link to comment
Share on other sites

Global $handle = DLLCall("user32.dll","long","GetDC","hwnd",0)

For $x = 0 to @DesktopWidth
    For $y = 0 to @DesktopHeight
        PixelDraw(@DesktopWidth - $x, $y,PixelGetColor($x, $y))
    Next
Next        
        
Func PixelDraw($XCoord, $YCoord, $Color)
   DllCall("gdi32","long","SetPixel", "long",$handle[0], "long", $XCoord, "long", $YCoord, "long", $Color)
   If @error = 1 Then
      Return 0
   Else
      Return 1
   EndIf
EndFunc

reflects the screen

All blue elements turn red and all red elements turn blue

using Hex(PixelGetColor($x, $y),6) color seems to be inverted.

Edited by torels

Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org

Link to comment
Share on other sites

Global $handle = DLLCall("user32.dll","long","GetDC","hwnd",0)

For $x = 0 to @DesktopWidth
    For $y = 0 to @DesktopHeight
        PixelDraw(@DesktopWidth - $x, $y,PixelGetColor($x, $y))
    Next
Next        
        
Func PixelDraw($XCoord, $YCoord, $Color)
   DllCall("gdi32","long","SetPixel", "long",$handle[0], "long", $XCoord, "long", $YCoord, "long", $Color)
   If @error = 1 Then
      Return 0
   Else
      Return 1
   EndIf
EndFunc

reflects the screen

All blue elements turn red and all red elements turn blue

using Hex(PixelGetColor($x, $y),6) color seems to be inverted.

GetPixel( hDC , ( int )x , ( int )y ); // returns RGB( r , g , b )

SetPixel( hDC , ( int )x , ( int )y , (char)RGB( r , g , b ) );

Edited by GoodMan
Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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