Jump to content

what happened to PixelGetColor ()!?


Recommended Posts

a while ago I was making a program which used this lovely function a lot.

I made arrays with pixel values of something on the screen. an icon or a letter. then I saved these arrays in a String.

and then, once I had a database of saved arrays, I could look around the screen by comparing arrays from the screen and arrays from my database and therefore find whatever I wanted on the screen.

a primitive form of OCR I guess.

the only thing is now...the PixelGetColor() function is a lot slower. I used to be able to take 100x100 arrays (100x100 pixel pictures) but now it takes ages.

anybody else had a similar problem?

I know I am now on another PC so that could be the cause, but the hardware is much better. I am also using windows 7 whereas before I used xp.

I guess people here have made some form of OCR. if yes, how did you solve this issue? if you have to look through the entire screen for one letter for example, there is no way you will get done in time. even in a low resolution like 800x600. calling the PixelGetColor() 800*600 times just wont work so I am guessing there is a way around this to get an array of your screen?

Edited by gehenna
Link to comment
Share on other sites

  • Moderators


You might get some more information here - it seems it is a Win 7 problem. I do not use the function much, so I cannot offer anything more than that, sorry. :mellow:


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:


ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area


Link to comment
Share on other sites

I know I am now on another PC so that could be the cause, but the hardware is much better. I am also using windows 7 whereas before I used xp.

Windows 7 and the lovely compositing of the graphics. You may need to turn off the fancy compositing effects to get good performance. XP does not do that compositing so has better performance with graphical functions.


Ooh, the quote is not quoting correct. Hmm, title ] was missing.

Edited by MHz
Link to comment
Share on other sites

Please take a look at THIS thread, I talked a bit about why it happens, and posted code to fix it in a user-friendly way.

Please note that Windows Vista seems to not respond correctly to that function, as noted in the 2 last posts. I don't know why that happens.

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

  • Recently Browsing   0 members

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