BobTheEponge Posted December 10, 2007 Share Posted December 10, 2007 (edited) Hello. I use an autoit script with windows xp. It generally functions very well. I have been using it since January without problem. I just tried to use this script on a new computer that works with Windows Vista. My script becomes very slow. After looking for the origin of this, i found that it seems to come from the function PixelGetColor. Is there some configuration to do so that PixelGetColor speeds up ? I use AutoIt v3.2.10.0. Below, the part of code that i discovered to be very slow : for $i = 1 to 25 $CurrentColor[$i] = PixelGetColor(20 + ($i-1) * 4 , 120) Next Thank you for your answers. Edited December 10, 2007 by BobTheEponge Link to comment Share on other sites More sharing options...
sandman Posted December 11, 2007 Share Posted December 11, 2007 A memory-hogging code like that would definitely slow down Vista. It must be something with your hardware that cannot run as quickly with Vista that is making this slow down now that you upgraded. You're asking AutoIt to check 25 pixel colours in around 100 milliseconds. Putting a Sleep() function into the For loop will use less memory, but take a teeny bit more time. Sleep(100) should be good, and you won't be able to notice a 100-millisecond pause. [center]"Yes, [our app] runs on Windows as well as Linux, but if you had a Picasso painting, would you put it in the bathroom?" -BitchX.com (IRC client)"I would change the world, but they won't give me the source code." -Unknownsite . blog . portfolio . claimidcode.is.poetry();[/center] Link to comment Share on other sites More sharing options...
LarryDalooza Posted December 11, 2007 Share Posted December 11, 2007 googled info... "On Vista, GDI is software-emulated. The result is that everything has to happen in system memory. So when you blit from the DC you got for the DX surface, it has to transfer that data into system memory before it can blit. I believe GDI does a very slow copy of the memory one pixel at a time. You can dramatically improve the speed on Vista if you use GetRenderTargetData to copy the DX surface entirely into system memory surface, and then get a DC from that." Lar. AutoIt has helped make me wealthy Link to comment Share on other sites More sharing options...
BobTheEponge Posted December 11, 2007 Author Share Posted December 11, 2007 googled info..."On Vista, GDI is software-emulated. The result is that everything has to happen in system memory. So when you blit from the DC you got for the DX surface, it has to transfer that data into system memory before it can blit. I believe GDI does a very slow copy of the memory one pixel at a time. You can dramatically improve the speed on Vista if you use GetRenderTargetData to copy the DX surface entirely into system memory surface, and then get a DC from that."Lar.thank you lar.You're right.I looked at what you said. It comes from the GDI. I disabled transparency AND choosed the "windows classic" windows display.It functions again at a normal speed.Thanks 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