Jump to content

PixelGetColor problem


akroon
 Share

Go to solution Solved by akroon,

Recommended Posts

Seeing how your PC is so slow, have you tried to optimize it first? Do this and it may help with your speed:

1. download and install CCleaner. http://www.piriform.com/go/ccleaner.com

2. run it with default settings except you will need to check the option "wipe free space". This is critical for I bet your HDD is trashing big time. This will greatly reduce the trashing.

3. defrag

4. Look at your startup and see what is running and shut off or remove what you really do not need. For example you may have old applications installed you no longer use. If you don;t use them, uninstall them.

5. Run a maulware scan. There are many scanners out there. For example use SpybotSD. That is a free application. If you find you are infected send me an IM and I will help you clean your rig. I've done this sort of thing for many years and I'm pretty good at that sort of thing.

Once you get this done then let us know. We can then get you up to speed with using controls. There is no point in going further in doing a script until you get your rig fixed.

Link to comment
Share on other sites

  • Developers

I have already posted when i open this tread

Ok, last try before closing this chapter.

Have you looked at how that looks?

What do you expect?

Next reply that doesn't give anything to go on or being none constructive will autoclose this topic.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Ok, last try before closing this chapter.

Have you looked at how that looks?

What do you expect?

Next reply that doesn't give anything to go on or being none constructive will autoclose this topic.

Jos

 

 

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)

 

How you can see Palestinian have been rewrited it very well.

Now, this was the code with function PixelGetColor, and this is the code with library FastFind.

#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    
  $handlesize=WinGetClientSize($handle)
   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=FFGetPixel($xy[0],$xy[1],FFSnapShot(0,0,$handlesize[0],$handlesize[1],0,$handle))
   GUICtrlSetData($pcheckinput,$xy,1)
   GUICtrlSetBkColor($colortaked,$xy)
   MsgBox(1,"",$handle) 

This code don't work, can you help me to use correctly this library? The function FFGetPixel return me always the value -1.

I have saw how it work and what can do with it so i think using this library all my problem will solved.

Thanx.

p.s. remember to include FastFind.au3

Edited by akroon
Link to comment
Share on other sites

Really, that always returns -1? I'd be very surprised if it returned anything, as that code won't run as is. You didn't even put an include line for FastFind.au3 in it.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

  • Developers

i have in my program! i just forgot put there...

...and you are expecting what exactly now?

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers

?do=embed' frameborder='0' data-embedContent>

this is the library... Now i just need help to use function FFGetPixel of this library. I just know it work with function FFSnapShot, i tryed and i don't know why nt work. Please help me.

So let me get this strait. You expect us to take your posted script, which will not run as is, and then do some magic to it to make it run so we can test.

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers

There are only an error on function FFGetPixel!! Do you want help me or not? :(

have you copied and pasted the posted code and tried to run it at all?

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Solution

Yes, the code run if you include FastFind.au3 and put FastFind64.dll near your program! The problem is just this, the function FFGetPixel return me always the value - 1

*********************************************************************************************

I HAVE SOLVED MY PROBLEM ALONE! :ranting:  :ranting:  :thumbsdown:  :thumbsdown:

Edited by akroon
Link to comment
Share on other sites

  • Developers

Yes, the code run if you include FastFind.au3 and put FastFind64.dll near your program! The problem is just this, the function FFGetPixel return me always the value - 1

*********************************************************************************************

I HAVE SOLVED MY PROBLEM ALONE! :ranting:  :ranting:  :thumbsdown:  :thumbsdown:

Good for you ;)

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

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