CableGuy Posted November 19, 2013 Share Posted November 19, 2013 Hi, I want to compare 2 images i get from _ScreenCapture_Capture(). I search a while and read a lot about ImageMagick and i think i figured out 2 ways i can do this. The first way could be an DllCall. The other way is the COM-Object. First i tried the DllCall but this is not working. I´m always get an Error 1. I think there something wrong with my parameters. Local $result = DllCall($dll, "double", "MagickCompareImages","metric","PSNR","uint",$hReference,"uint",$hImage) COM-Object could work but it seems that he´s not accepting the variable which contains the HBITMAP returned from ScreenCapture_Capture(). I also tried to use _GDIPlus_BitmapCreateFromHBITMAP() for this variable, with no luck. He always returns me "The requested action with this object has failed." $oCompareObject = ObjCreate("ImageMagickObject.MagickImage") $result = $oCompareObject.Compare("-metric", "PSNR", _ $hReference, _ $hImage, _ "null:") Could anyone help me to fix this problem ? Thanks in advance Link to comment Share on other sites More sharing options...
jftuga Posted November 19, 2013 Share Posted November 19, 2013 If you can't find an AutoIt solution, I solved this problem some time ago with another program. Here is the info: https://github.com/jftuga/Misc/tree/master/Finding_the_differences_between_two_similar_images -John Admin_Popup, show computer info or launch shellRemote Manager, facilitates connecting to RDP / VNCProc_Watch, reprioritize cpu intensive processesUDF: _ini_to_dict, transforms ini file entries into variablesUDF: monitor_resolutions, returns resolutions of multiple monitorsReport Computer Problem, for your IT help deskProfile Fixer, fixes a 'missing' AD user profile Link to comment Share on other sites More sharing options...
CableGuy Posted November 20, 2013 Author Share Posted November 20, 2013 Thanks for your reply! Calling an exe could be a solution but it is too slow for my program. Any other ideas ? Link to comment Share on other sites More sharing options...
water Posted November 20, 2013 Share Posted November 20, 2013 What do you want to achieve? Compare the images and check if they are equal? Or get the areas where the picture has changed? My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
CableGuy Posted November 20, 2013 Author Share Posted November 20, 2013 I want to check if two pictures are equal. And if they are not equal i want to get an percentages or something else for the difference between the two pictures. Thank you Link to comment Share on other sites More sharing options...
water Posted November 20, 2013 Share Posted November 20, 2013 I see. Can you please tell us what you try to achieve? I mean, why do you need to compare two screenshots? My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
CableGuy Posted November 20, 2013 Author Share Posted November 20, 2013 i want detect changes made on my desktop. if the images are equal it´s not necessary to save the screenshot again. Link to comment Share on other sites More sharing options...
water Posted November 20, 2013 Share Posted November 20, 2013 Changes on the desktop means: New, deleted or moved icons. Anything else? Wouldn't it be easier to monitor the icons? My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
CableGuy Posted November 20, 2013 Author Share Posted November 20, 2013 i´m also want to see if someone is working on my pc, starting programs, browse my files and so on.... Link to comment Share on other sites More sharing options...
water Posted November 20, 2013 Share Posted November 20, 2013 I would lock the PC so noone can work there But I think it is easier to check for Mouse moves, new tasks etc. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
CableGuy Posted November 20, 2013 Author Share Posted November 20, 2013 Thanks for your suggestion. But i would prefer to make screenshots so it´s easier to reproduce changes. Link to comment Share on other sites More sharing options...
CableGuy Posted November 23, 2013 Author Share Posted November 23, 2013 *bump* Link to comment Share on other sites More sharing options...
Rogue5099 Posted November 23, 2013 Share Posted November 23, 2013 Although the intentions may be pure and for security, this could also lead to spyware. My projects: Inventory / Mp3 Inventory, Computer Stats 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