Sign in to follow this  
Followers 0
gehenna

what happened to PixelGetColor ()!?

6 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites



gehenna,

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:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

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

 

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

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.

Edit:

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

Edited by MHz

Share this post


Link to post
Share on other sites

hmm, ill try and turn of Aero and the other fancy windows 7 stuff and see how it goes. thanks for the advice :mellow:

Share this post


Link to post
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.

Share this post


Link to post
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
Sign in to follow this  
Followers 0