At present, many softwares do not have standard controls and cannot use the functions of QM's search controls. Therefore, using image capture and recognition functions has become the preferred solution.
But I have encountered a problem, the image format of the interception is BMP. If my screen resolution is very high and the captured images are many, the generated exe file is very large.
Is it possible to save the captured image as PNG? This can reduce the size of the exe file, is this possible?
RECT r __GdiHandle hb if(!CaptureImageOrColor(hb 0 _hwndqm "" r))ret mkdir"QM_CaptureImages""$desktop$";;create folder if it doesnt exist to save images in str sFolderName ="$desktop$\QM_CaptureImages\" str sFileName.timeformat("{yyyy-MM-dd}_{HH-mm-ss}_QmCapture");;unique filename to avoid problems str sFormat =".png";;i use png for smaller filesize str sFile.format("%s%s%s" sFolderName sFileName sFormat) ;save image #compile"__Gdip" GdipBitmap im if(!im.FromHBITMAP(hb))end"error" if(!im.Save(sFile))end"error" out sFile
05-08-2019, 12:43 AM (This post was last modified: 05-08-2019, 12:46 AM by win.)
Maybe my request is not clear enough,
Using the above dialog box, after the screenshot, the default will be added to the resource use bmp format. If there are a lot of screenshots, the generated exe will be very large, the process automatic software RPA, the dependence on the screenshot is very large, so I proposed the above request
RECT r __GdiHandle hb if(!CaptureImageOrColor(hb 0 _hwndqm "" r))ret mkdir"QM_CaptureImages""$desktop$";;create folder if it doesnt exist to save images in str sFolderName ="$desktop$\QM_CaptureImages\" str sFileName.timeformat("{yyyy-MM-dd}_{HH-mm-ss}_QmCapture");;unique filename to avoid problems str sFormat =".png";;i use png for smaller filesize str sFile.format("%s%s%s" sFolderName sFileName sFormat) ;save image #compile"__Gdip" GdipBitmap im if(!im.FromHBITMAP(hb))end"error" if(!im.Save(sFile))end"error" out sFile 0.2 int w=win("Find Image""#32770") int c=id(5 w);;push button 'Use existing...' but+ c
05-08-2019, 02:14 AM (This post was last modified: 05-08-2019, 02:20 AM by win.)
Thank you for your help, this method is good.
I think maybe some code is needed.
1. Add to resources
2. Displayed in the edit box
I feel this is too difficult.
05-08-2019, 02:24 AM (This post was last modified: 05-08-2019, 02:26 AM by win.)
I don't understand why the bmp image format is used by default.
Because the recognition accuracy is high?
Add code after the custom capture function
1. Add to the resource first
2. Then set the name of the picture in the edit box.
is it possible?