torels Posted November 6, 2008 Share Posted November 6, 2008 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 More sharing options...
ChangMinYang Posted November 6, 2008 Share Posted November 6, 2008 Hi thereDoes 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 advanceAutoItSetOption( "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 More sharing options...
torels Posted November 6, 2008 Author Share Posted November 6, 2008 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 More sharing options...
Pain Posted November 6, 2008 Share Posted November 6, 2008 Can't see what's wrong, try post a code snippet.$var = PixelGetColor(1, 1) ConsoleWrite(Hex($var, 6))Returns: 035EE9 Link to comment Share on other sites More sharing options...
torels Posted November 6, 2008 Author Share Posted November 6, 2008 (edited) 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 November 6, 2008 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 More sharing options...
ChangMinYang Posted November 6, 2008 Share Posted November 6, 2008 (edited) 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 November 6, 2008 by GoodMan Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now