TroisVerites Posted April 24, 2015 Share Posted April 24, 2015 Hello, I try to find functions FindColorsTol ; FindColorsSpiralTol ; FindDTM working on a TscarBitmap. 1) I want to avoid the capture of this bitmap too many times then I use : GetClient.CaptureEx 2) I am looking for the functions working on the TscarBitmap that I captured. 3) At the end , I release the TscarBitmap Can you help me ? Quote Link to comment Share on other sites More sharing options...
Bixby Sayz Posted April 24, 2015 Share Posted April 24, 2015 (edited) Something like this??? program New; var Bmp: TSCARBitmap; BmpClient: TSCARBitmapClient; CurClient: TSCARClient; begin CurClient := GetClient(); // Save current client so we can restore it later. Bmp := CurClient.Capture(); // Grab screenshot of current client. BmpClient := TSCARBitmapClient.Create(Bmp); // Create client from bitmap. SetClient(BmpClient); // Set new client as SCAR's target. // Do something here. SetClient(CurClient).Free(); // Set SCAR's target back to orignal client and // free bitmap client. Bmp.Free(); // Free bitmap. CurClient.Free(); // Free client object now that we're done with it. end. Edited April 24, 2015 by Bixby Sayz Quote Link to comment Share on other sites More sharing options...
TroisVerites Posted April 25, 2015 Author Share Posted April 25, 2015 Thanks for the answer. I tried to use like this but the code is not faster. 1) Capture around 1 ..2 ms 2) FindColorsTol around 15..32ms * X times. This time is when the function didn t find any color. I think the time used by FindColorsTol , depends of the area size 'Box( 65, 100,1024, 575); I need to find a way better Quote Link to comment Share on other sites More sharing options...
Bixby Sayz Posted April 25, 2015 Share Posted April 25, 2015 I don't really understand what you are trying to do. Why are you capturing to bitmap in the first place instead of simply searching on the client? And if it is not finding the color then your colors are wrong, or it has to wait until the colors appear? It is often difficult to help when given minimal details to go on. Quote Link to comment Share on other sites More sharing options...
TroisVerites Posted April 26, 2015 Author Share Posted April 26, 2015 HI BixBy I try to make some finds for a color in a area as quicker as possible. 1) My first thinkings were : - Capture the Area - Make finds here , more than one time. 2) I was wrong , the time is the same , as if I search in client. 3) May be , I need to modify the way I use those functions: - Reduce area size - use FindColorsSpiralTol instead normal FindColorsTol , FindColors 4) I like to know what happen inside the functions. I don t have the source code then I can not see it. Quote Link to comment Share on other sites More sharing options...
Bixby Sayz Posted April 27, 2015 Share Posted April 27, 2015 - Reduce area size This more than anything will speed things up. There is a limit as to how fast you can search. It does take time to perform a search. Unless you have trouble reading the client directly I would avoid capturing to a bitmap. It is just going to slow things down. I am curious what you are doing that getting the absolute fastest search time is vital. Screen must be changing very fast. Quote Link to comment Share on other sites More sharing options...