akroon Posted January 20, 2014 Share Posted January 20, 2014 (edited) Hi all i have a problem with function pixelgetcolor. This is the code.#include <GUIConstantsEx.au3>#include <ColorConstants.au3>#include <WindowsConstants.au3>#include <GUIConstants.au3>#include <GuiEdit.au3>#include <File.au3>#include <INet.au3>#include <Color.au3>AutoItSetOption("MouseCoordMode", 2)GUICreate("My program",305,305)$pcheckinput=GUICtrlCreateInput("0 0 0000000",80,210,120,20)$colortaked=GUICtrlCreateGraphic(205,210,20,20)$handle = WinGetHandle("My program")If @error Then MsgBox(4096, "Error", "Could not find program") ExitElse MsgBox(0,"Success","program find successfully")EndIfGUISetState(@SW_SHOW)MsgBox(0,"Point checker","move mouse at the point and wait, the window will close in 5 seconds",5)$xy=MouseGetPos()GUICtrlSetData($pcheckinput,$xy[0]&" "&$xy[1]&" ")$xy=PixelGetColor($xy[0],$xy[1],$handle)GUICtrlSetData($pcheckinput,$xy,1)GUICtrlSetBkColor($colortaked,$xy) The problem is that: the function pixelgetcolor don't return the pixelcolor of the window of "My program". This program is another program (not the program i'm running for check pixelcolor). How can solve this problem? Thanx. Edited January 20, 2014 by akroon Link to comment Share on other sites More sharing options...
Palestinian Posted January 20, 2014 Share Posted January 20, 2014 I tested your code and from what I understood, it worked just fine! #include <GUIConstantsEx.au3> #include <ColorConstants.au3> #include <WindowsConstants.au3> #include <GUIConstants.au3> #include <GuiEdit.au3> #include <File.au3> #include <INet.au3> #include <Color.au3> AutoItSetOption("MouseCoordMode", 2) GUICreate("My program",305,305) $pcheckinput=GUICtrlCreateInput("0 0 0000000",80,210,120,20) $colortaked=GUICtrlCreateGraphic(205,210,20,20) $handle = WinGetHandle("My program") If @error Then MsgBox(4096, "Error", "Could not find program") Exit Else MsgBox(0,"Success","program find successfully") EndIf GUISetState(@SW_SHOW) MsgBox(0,"Point checker","move mouse at the point and wait, the window will close in 5 seconds",5) $xy=MouseGetPos() GUICtrlSetData($pcheckinput,$xy[0]&" "&$xy[1]&" ") $xy=PixelGetColor($xy[0],$xy[1],$handle) GUICtrlSetData($pcheckinput,$xy,1) GUICtrlSetBkColor($colortaked,$xy) MsgBox(1,"",$handle) Link to comment Share on other sites More sharing options...
Bert Posted January 21, 2014 Share Posted January 21, 2014 Are you running the "Program" in a web browser? The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
akroon Posted January 22, 2014 Author Share Posted January 22, 2014 Are you running the "Program" in a web browser? No the "program" is .exe Link to comment Share on other sites More sharing options...
akroon Posted January 22, 2014 Author Share Posted January 22, 2014 (edited) I tested your code and from what I understood, it worked just fine! #include <GUIConstantsEx.au3> #include <ColorConstants.au3> #include <WindowsConstants.au3> #include <GUIConstants.au3> #include <GuiEdit.au3> #include <File.au3> #include <INet.au3> #include <Color.au3> AutoItSetOption("MouseCoordMode", 2) GUICreate("My program",305,305) $pcheckinput=GUICtrlCreateInput("0 0 0000000",80,210,120,20) $colortaked=GUICtrlCreateGraphic(205,210,20,20) $handle = WinGetHandle("My program") If @error Then MsgBox(4096, "Error", "Could not find program") Exit Else MsgBox(0,"Success","program find successfully") EndIf GUISetState(@SW_SHOW) MsgBox(0,"Point checker","move mouse at the point and wait, the window will close in 5 seconds",5) $xy=MouseGetPos() GUICtrlSetData($pcheckinput,$xy[0]&" "&$xy[1]&" ") $xy=PixelGetColor($xy[0],$xy[1],$handle) GUICtrlSetData($pcheckinput,$xy,1) GUICtrlSetBkColor($colortaked,$xy) MsgBox(1,"",$handle) Are you sure the color it get is correct? I get wrong color. You will see the color getted in guigraphich. Edited January 22, 2014 by akroon Link to comment Share on other sites More sharing options...
Xibalba Posted January 22, 2014 Share Posted January 22, 2014 (edited) In order to get help, you need to clearly define the problem. More specificly this part: "The problem is that: the function pixelgetcolor don't return the pixelcolor of the window of "My program". This program is another program (not the program i'm running for check pixelcolor). How can solve this problem? Thanx." You also need to describe what the problem really is: what result did you get - and what did you expect to get? Edited January 22, 2014 by Xibalba Link to comment Share on other sites More sharing options...
akroon Posted January 22, 2014 Author Share Posted January 22, 2014 From the function pixelgetcolor i get the color of desktop and not of the program. Sorry for my english Link to comment Share on other sites More sharing options...
Damein Posted January 22, 2014 Share Posted January 22, 2014 Are you by chance trying to pull the color from a 3D app? Most recent sig. I made Quick Launcher W/ Profiles Topic Movie Database Topic & Website | LiveStreamer Pro Website | YouTube Stand-Alone Playlist Manager: Topic | Weather Desktop Widget: Topic | Flash Memory Game: Topic | Volume Control With Mouse / iTunes Hotkeys: Topic | Weather program: Topic | Paws & Tales radio drama podcast mini-player: Topic | Quick Math Calculations: Topic Link to comment Share on other sites More sharing options...
Palestinian Posted January 23, 2014 Share Posted January 23, 2014 Are you sure the color it get is correct? I get wrong color. You will see the color getted in guigraphich. That's what I get when I use the script you provided, I pointed at the light blue color in the "au3" word. Link to comment Share on other sites More sharing options...
JohnOne Posted January 23, 2014 Share Posted January 23, 2014 Look at setting pixelcoordmode as well as mousecoordmode. akroon 1 AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
akroon Posted January 24, 2014 Author Share Posted January 24, 2014 (edited) Are you by chance trying to pull the color from a 3D app? No, it isn't That's what I get when I use the script you provided, I pointed at the light blue color in the "au3" word. Try to use other little programm (like 500x500) maybe you get the right value becuase the browser is full screen. Look at setting pixelcoordmode as well as mousecoordmode. This is a good solution but i don't understand why adding handle variable at function doesn't work Anyway i want get the pixel color while the window are not active. With AutoItSetOption i can only get the thinks of active windows. I really want solve this problem with PixelGetColour because it's the best way for my program. Maybe i add somenthink wrong at variable $handle ?? Please help me. Edited January 24, 2014 by akroon Link to comment Share on other sites More sharing options...
JohnOne Posted January 24, 2014 Share Posted January 24, 2014 So you want to get the colour of a pixel in a window that is not visible on the screen? AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Blue_Drache Posted January 24, 2014 Share Posted January 24, 2014 Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache Link to comment Share on other sites More sharing options...
akroon Posted January 25, 2014 Author Share Posted January 25, 2014 So you want to get the colour of a pixel in a window that is not visible on the screen? No, the windows is on the screen but is not active ("selected") Link to comment Share on other sites More sharing options...
JohnOne Posted January 26, 2014 Share Posted January 26, 2014 I have no idea why that parameter is there, all I know is that to get a pixel color relative to a window, you must set PixelCoordMode. What is the problem you have exactly, with that? AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
akroon Posted January 27, 2014 Author Share Posted January 27, 2014 Ok i try to explain better. I have this "program" working at the corner of the screen, so i want get pixelcolor while the autoitprogram is working on another program. If you don't understand i can make some screenshot for show the situation. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 27, 2014 Moderators Share Posted January 27, 2014 akroon, i can make some screenshot for show the situationAn excellent idea! M23 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: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
JohnOne Posted January 27, 2014 Share Posted January 27, 2014 OK, I remember now, the handle parameter is used for the exact reason you need to set pixelcoordmode, so it knows which window to use when that mode is set to 0 or 2. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
akroon Posted January 27, 2014 Author Share Posted January 27, 2014 (edited) Here's the screenshot I want just this: the pixelgetcolor will work on the window not depending of its position ( i want be free to put where i want on the screen so can't use desktop mode) Edited January 27, 2014 by akroon Link to comment Share on other sites More sharing options...
Bert Posted January 27, 2014 Share Posted January 27, 2014 Seeing you want to work with a webpage - you can use the IE controls built into AutoIt and do what you want with IE. No the "program" is .exe Seeing you say that above when I asked you if the app was a web based application and you show a screenshot of a web browser later - that tells me you are really trying to NOT say what the name of the application is. Cut the bullshit. What is the name of the application? So far you are wasting our time with your refusal to be straight with us. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Recommended Posts