Leaderboard
Popular Content
Showing content with the highest reputation on 07/29/2023 in all areas
-
"GuiCtrls_HiDpi" (UDF in progress)
simplercoder000 and one other reacted to argumentum for a topic
... lets do some marketing first: pardon the image size of 225% scale on another monitor The idea is to have some DPI awareness in our GUIs and with this all you have to do is prefix "_HiDpi_" to your current code. Simple. This version ( HiDpi v. 0.2023.7.29(b) stable.zip ) is stable but only system aware. ( pictures above ) This next version ( HiDpi v. 0.2023.8.3(a) under development.zip ) is what I've got so far in regards of per-monitor awareness This one ( HiDpi v. 0.2023.8.4(ResizeTestbed) under development.zip ) is for the brave of heart. I'm looking for ideas. This is a testbed for anyone wanting to contribute regarding resizing controls. I have now started to use _WinAPI_DPI.au3 because I feel that this UDF is ready for that UDF. Therefore, too many and too big files for copy and paste. And that is good. Means that the UDF is getting closer to stable. FAQ (of sorts) Q: When did you come up with this ? A: Never. These are helper functions for _WinAPI_SetDPIAwareness.au3 but I did not get to finish. Nonetheless it's functional as is and applies to most of the cases in need of DPI awareness. Per-monitor would need more involved coding and I only have so much time and know how for now. Q: Will you open a ticket and ask to be included in the standard UDFs ? A: No. This is a just for now. Eventually the functionality would be a standard feature without the need of this. Q: Will you add ... A: Only in the case that either, I realize is needed and code it or, you code it and ask to be included in this bundle of functions UDF Q: This is not working ... A: The best way to go about a problem with this code is to open it's own thread in GUI Help and Support and post there with a mention of me. I'll read and answer there. Q: Are you going to share "logo4.gif", "SampleAVI.avi", etc. A: You are right. I forgot to say that the example file will work as expected if created in "..\Examples\GUI\HiDpi_v_n.n.n.n\", as a subfolder of where "SampleControls.au3" is at. There it will find all the files required for the example. Because after all, this example is that example but "_HiDpi_fied" ( so to say ). Q: Is there a tool that will magically update all my old scripts ? A: I've posted a script to get you closer but is not magical. Should work just fine for simple GUIs. Q: Are you going to work on a Per-monitor version ? A: yes, as time permits.2 points -
@KaFu was faster. Here my hack: ;Coded by UEZ build 2023-08-04 #include <WinAPIFiles.au3> #include <WinAPIHObj.au3> Global $sFile = FileOpenDialog("Select a file", "", "All (*.*)", $FD_FILEMUSTEXIST), $sSavePath = "c:\Temp\" If @error Then Exit MsgBox($MB_ICONERROR, "ERROR", "No file has been selected", 10) ExtractPNGFromFile($sFile, $sSavePath) Func ExtractPNGFromFile($sFileIn, $sPathOut = @ScriptDir, $bOverwrite = True) Local $iSize = FileGetSize($sFile), $nBytes Local $tBuffer = DllStructCreate("byte bin[" & $iSize & "]") Local Const $hFile = _WinAPI_CreateFile($sFile, 2, 2) If @error Or Not $hFile Then Return SetError(1, 0, 0) _WinAPI_ReadFile($hFile, $tBuffer, $iSize, $nBytes) _WinAPI_CloseHandle($hFile) Local $sBin = Binary($tBuffer.bin), $iPosS, $iPosE, $iPosN, $p = 1, $iStart, $iEnd, $c = 1, $cc, $sFilename If StringRight($sPathOut, 1) <> "\" Then $sPathOut = $sPathOut & "\" Do $iPosS = StringInStr($sBin, "89504E470D0A1A0A", 0, 1, $p) If $iPosS Then $iPosN = StringInStr($sBin, "89504E470D0A1A0A", 0, 1, $iPosS + 16) $iStart = BitShift($iPosS, 1) $iPosE = StringInStr($sBin, "49454E44AE426082", 0, 1, $iPosS + 16) ConsoleWrite($c & ": " & Hex(BitShift($iPosS, 1), 8) & ", " & Hex(BitShift($iPosN, 1), 8) & ", " & Hex(BitShift($iPosE, 1), 8) & @CRLF) If $iPosN And $iPosE > $iPosN Then $p = $iPosN Else If $iPosE Then $sFilename = $sPathOut & "PNG_extracted" & StringFormat("%02i", $c) & ".png" If Not $bOverwrite Then $cc = $c While FileExists($sFilename) $sFilename = $sPathOut & "PNG_extracted" & StringFormat("%02i", $cc) & ".png" $cc += 1 WEnd EndIf SavePNG($sFilename, $tBuffer.bin, $iStart, BitShift($iPosE, 1) + 8) $p = $iPosE + 16 $c += 1 Else ExitLoop EndIf EndIf EndIf Until Not $iPosS $sBin = 0 ConsoleWrite("Saved " & $c - 1 & " PNG files" & @CRLF) EndFunc Func SavePNG($sName, $tBin, $s, $e, $bOverwrite = True) Local $l = $e - $s, $nBytes Local $tBuffer = DllStructCreate("byte bin[" & $l & "]") $tBuffer.bin = BinaryMid($tBin, $s, $l) Local $hFile = _WinAPI_CreateFile($sName, $bOverwrite ? 1 : 0) If @error Or Not $hFile Then Return SetError(1, 0, 0) _WinAPI_WriteFile($hFile, $tBuffer, $l, $nBytes) _WinAPI_CloseHandle($hFile) ConsoleWrite($nBytes & " bytes written (found at address " & Hex($s - 1, 8) & ")" & @CRLF) EndFunc My code finds 3 PNGs in Door.dwg but 2 are corrupted. Finds now only 1 PNG image. Btw, it should find more than 1 PNG image if the file should contain several PNGs.1 point
-
Put the DWG file image in a GUI
argumentum reacted to Andreik for a topic
There are no native functions that support dwg files but you should find a third party application (like LibreDWG) to make the conversion from dwg to some sort of image file (bmp, png, jpg).1 point -
@mLipok Have you seen this? https://chromium.googlesource.com/chromium/src/+/master/docs/user_data_dir.md1 point
-
hm... I think you found a bug in my GitHub examples: https://github.com/mlipok/Au3WebDriver-testing/blob/a9375043de20645b5a861ee965d93e17fd6ab99b/wd_testing_helper.au3#L141-L181 It is because according to: Func _WD_CapabilitiesAdd($key, $value1 = Default, $value2 = Default) Local Const $sFuncName = "_WD_CapabilitiesAdd" If $value1 = Default Then $value1 = '' If $value2 = Default Then $value2 = '' this line: _WD_CapabilitiesAdd('args', '--profile-directory', Default) is equivalent to: _WD_CapabilitiesAdd('args', '--profile-directory', '') And I think this should be used/coded the way you mention: _WD_CapabilitiesAdd('args', '--profile-directory', 'Default')1 point
-
I think at least part of your issue may lie here because it looks incorrect in the args output. Default is an AutoIt keyword and needs to be enclosed in quotes to be treated as a string instead.1 point
-
"GuiCtrls_HiDpi" (UDF in progress)
argumentum reacted to mLipok for a topic
I indicate this UDF as a candidate for: https://www.autoitscript.com/wiki/User_Defined_Functions1 point -
1 point
-
"GuiCtrls_HiDpi" (UDF in progress)
argumentum reacted to mLipok for a topic
can you provide the same for _HiDpi_ControlGetPos() I mean there are many problems with clicking into Controls because of HiDpi, and some recalculation of control positions are needed before click point will be properly given.1 point -
"GuiCtrls_HiDpi" (UDF in progress)
mLipok reacted to argumentum for a topic
...this approach is simple and should work flawlessly if, all monitors have the same scaling. Otherwise will take the scaling of the monitor declared as primary, and adjust in a blurry way the difference. As a first step, should work for most people as they have only one monitor. Those with more than one, if bought together then is also functional. Now, those like me that have, in my case say, a 21:9 1080p next to a 16:10 4k, it looks perfect only for the primary but again, most people don't have such setup. Hence an incentive for me to have a full "PER_MONITOR_AWARE_V2" instead of the "SYSTEM_AWARE" that I posted.1 point -
"GuiCtrls_HiDpi" (UDF in progress)
argumentum reacted to UEZ for a topic
Hi @argumentum, I will test your script on Monday in the office where I have 3 monitors and can set different DPI settings per monitor.1 point -
Darien, I get a scroll bar displayed as soon as I go over 30 items: #include <GUIConstantsEx.au3> GUICreate("Test", 300, 100) $Combo = GUICtrlCreateCombo("", 10, 30, 280, 25) For $i = 1 To 31 GUICtrlSetData($Combo, "Combo Item Number: " & $i) Next GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $Combo ConsoleWrite(GUICtrlRead($Combo) & @CRLF) EndSwitch WEnd And you change the number of displayed items like this: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <ComboConstants.au3> ; Create 25 data items $sData = "|" For $i = 1 To 45 $sData &= $i & "|" Next $hGUI = GUICreate("Test", 500, 500) ; Create the combo with a read-only edit field and a scrollbar $hCombo = GUICtrlCreateCombo("", 10, 10, 100, 20, BitOr($CBS_DROPDOWNLIST, $WS_VSCROLL)) ; Set number of visible items GUICtrlSendMsg($hCombo, $CB_SETMINVISIBLE, 40, 0) GUICtrlSetData($hCombo, $sData) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Hope that helps, M231 point
-
Thanks @Melba23 I was having hard time finding the actual source post.1 point
-
n3wbie, It is a broken link - we have a lot after various forum updates. It should point to: M231 point
-
Yes, you were the 1000th download! I think it's pretty awesome that the author of the CodeScannerCrypter Bundle, which is one of the most prolific implementers of the CryptoNG UDF that I know of, was the one to actually help me achieve that milestone. Thanks @RTFC!1 point
-
When using GraphGDIplus UDF you can save the GUI directly after drawing the graph with _Draw_Graph() by adding something like this: #include <ScreenCapture.au3> _ScreenCapture_CaptureWnd(@ScriptDir & "\_graph.png", $GUI) I recommend to use png instead of jpg, because GDI might distort colors for jpg output. Edit: I saw that the GUI must be visible for this to work. But looking at the UDF I saw that it's possible to access the backbuffer directly, even if the GUI is not visible the graph is there. $Graph = _GraphGDIPlus_Create($GUI, 40, 30, 530, 520, 0xFF000000, 0xFF88B3DD) ... ... _Draw_Graph() ; directly after draw call _GDIPlus_ImageSaveToFile($Graph[16], @ScriptDir & "\_graph.png")1 point
-
Create an svg file https://www.w3schools.com/graphics/svg_line.asp1 point
-
Tesseract (Screen OCR) UDF
mLipok reacted to seangriffin for a topic
This UDF provides text capturing support for applications and controls using Tesseract - an OCR engine currently developed by Google. Tesseract was originally developed as proprietary software at Hewlett-Packard between 1985 until 1995. After ten years without any development taking place, Hewlett Packard and UNLV released it as open source in 2005. Tesseract is currently developed by Google and released under the Apache License, Version 2.0. Tesseract is considered one of the most accurate free software OCR engines currently available. It was one of the top 3 engines in the 1995 UNLV Accuracy test. My main goal in developing this UDF is to provide AutoIT users with a free Screen OCR solution that competes with other commercial (payed) technologies like Microsoft Office Document Imaging (MODI) and Textract. REQUIREMENTS: AutoIt3 3.2 or higherTesseract 2.01 or aboveINSTALLATION: To install Tesseract: Run the file http://web.aanet.com.au/seangriffin/Tesseract201.exe.Follow the installation instructions.LIST OF FUNCTIONS: DEMONSTRATION: <Under Construction> EXAMPLES: _TesseractControlCapture.au3_TesseractControlFind.au3 DOWNLOAD: Latest Version - v0.6 (17/03/09) Tesseract.au31 point