Leaderboard
Popular Content
Showing content with the highest reputation on 04/15/2023 in all areas
-
@Kafu worked perfectly, you really are the man, thanks for this solution.1 point
-
This work for me. Sleep(1000) libvlc_video_set_aspect_ratio($hLibVLC_dll, $mp, "16:9") ConsoleWrite(@error & @tab & @extended & @crlf) Sleep(1000) libvlc_video_set_aspect_ratio($hLibVLC_dll, $mp, "4:3") ConsoleWrite(@error & @tab & @extended & @crlf) Sleep(1000) libvlc_video_set_aspect_ratio($hLibVLC_dll, $mp, "16:9") ConsoleWrite(@error & @tab & @extended & @crlf) Sleep(1000) libvlc_video_set_aspect_ratio($hLibVLC_dll, $mp, "1:1") ConsoleWrite(@error & @tab & @extended & @crlf) Sleep(1000) libvlc_video_set_aspect_ratio($hLibVLC_dll, $mp, "211:100") ConsoleWrite(@error & @tab & @extended & @crlf) Sleep(1000) libvlc_video_set_aspect_ratio($hLibVLC_dll, $mp, "") ConsoleWrite(@error & @tab & @extended & @crlf) Func libvlc_video_set_aspect_ratio($hLibVLC_dll, $mp, $asp_ratio) ; // "", "1:1", "4:3", "5:4", 16:9", "16:10", "221:100", "235:100", "239:100" ; https://python-forum.io/thread-17906.html Local $taiData = DllStructCreate("char[32]") DllStructSetData($taiData, 1, $asp_ratio) Local $aRet = DllCall($hLibVLC_dll, "none:cdecl", "libvlc_video_set_aspect_ratio", "handle", $mp, "ptr", DllStructGetPtr($taiData)) If @error <> 0 Then Return SetError(@error, @extended, 0) Return $aRet[0] EndFunc ;==>libvlc_video_set_aspect_ratio1 point
-
JSON UDF in pure AutoIt
littlebigman reacted to TheDcoder for a topic
As long it's valid JSON any parser worth its salt would be able to handle it, the internal structure doesn't matter.1 point -
JSON UDF in pure AutoIt
littlebigman reacted to mccree for a topic
is that what you mean? #include <JSON.au3> $test = '{"type":"FeatureCollection","timestamp":"2023-04-15T05:50:27Z","features":[{"type":"Feature","properties":{"@id":"way/156798372","name":"Location1"},"geometry":{"type":"Point","coordinates":[1.5978915,43.9694576]},"id":"way/156798372"},{"type":"Feature","properties":{"@id":"way/231992599","name":"Location2"},"geometry":{"type":"Point","coordinates":[1.8692822,44.0008908]},"id":"way/231992599"}]}' $JSON = _JSON_Parse($test) $features = _JSON_Get($JSON, 'features') For $I = 0 To UBound($features) - 1 $coordinates = _JSON_Get($JSON, 'features.['&$I&'].geometry.coordinates') $name = _JSON_Get($JSON, 'features.['&$I&'].properties.name') For $c = 0 To UBound($coordinates) - 1 $coordinates = _JSON_Get($JSON, 'features.['&$I&'].geometry.coordinates.['&$c&']') MsgBox(0,$name,$coordinates) Next Next1 point -
I had in mind more of an UDF approach where you do not know how the caller has created its GUI window. By using GUIGetStyle, you can save the current styles before you full screen its window. And use that save styles to restore it. Hotkey applies to any window in any circumstances while GUISetAccelerators is specifically design to address a specific window. It is a more appropriate solution. $iFullScreen could be declare as Local Static inside the function. There is no need to create a Global var in that situation. ps. I am always glad to help an active member1 point
-
Thanks for your response. I feel like I'm a blind man touching an elephant. I read about fullscreen mode and I tried and failed. I didn't understand what the compressed video meant. I even "compressed" an mp4 file at a website from 3324KB to 1732KB, but it didn't work. I use about 20 different video files to test my project in mp4, webm and flv formats, Big_Buck_Bunny.webM being my favorite. Upon reading your suggestion, I just tested the code with an mp4 file I never used before, and it did play in fullscreen mode. I tested some of my other files including mkv and avi files and they also played in full screen mode. I have been testing with wrong files all the time. The problem is I still don't know how to differentiate a "compressed" file from non-compressed. I hope I can differentiate them by a file property value. I will consider my problem solved, though. Thanks again.1 point
-
@genius257 sorry for posting in my language because my automatic page translator was the one who made it go back to my language when I posted and I didn't realize it because it was in English when I created the topic and as for the functions I think what I need would not be to cut the video but yes fill the whole screen using libvlc_video_set_aspect_ratio() or maybe libvlc_video_set_scale but() I did several tests and I couldn't pass the right parameters using DllCall()1 point
-
I used this udf to crop parts of the screen to OCR "on the fly" using <this other udf> by @Danyfirex 1) once running, use ctrl-1 to bring up the crop tool 2) move and resize the tool to choose the area to select 3) Right click inside the selected area to OCR the content. (a MsgBox shows the result) use the Tray icon to close the program download both udfs and save them in the same folder together with this script ; download both udfs and save them in the same folder together with this script #include <.\CropTool.au3> ; https://www.autoitscript.com/forum/topic/203545-%E2%9C%82%EF%B8%8F-quick-crop-tool #include <.\UWPOCR.au3> ; https://www.autoitscript.com/forum/topic/207324-uwpocr-windows-platform-optical-character-recognition-api-implementation/ #include <ScreenCapture.au3> Opt("TrayMenuMode", 3) ; The default tray menu items will not be shown and items are not checked when selected. These are options 1 and 2 for TrayMenuMode. Global $user32 = DllOpen("user32.dll") _GDIPlus_Startup() Local $idCrop = TrayCreateItem("Crop") TrayCreateItem("") ; Create a separator line. Local $idExit = TrayCreateItem("Exit") TraySetToolTip("Hit ctrl-1 to show crop."&@CRLF&"(move & resize the area)"&@CRLF&"right click in area to OCR"&@CRLF&"hit ESC to cancel") While 1 ; hit Control+1 to call the _Crop Function If _IsPressed("11", $user32) And _IsPressed("31", $user32) Then ; "11" CTRL key + "31" 1 key TrayItemSetState($idCrop, 128) ; Crop - Menuitem will be greyed out TrayItemSetState($idExit, 128) ; Exit - Menuitem will be greyed out _CropAndOCR() TrayItemSetState($idCrop, 64) ; Crop - Menuitem will be enabled TrayItemSetState($idExit, 64) ; Exit - Menuitem will be enabled EndIf Switch TrayGetMsg() Case $idCrop TrayItemSetState($idCrop, 128) ; Crop - Menuitem will be greyed out TrayItemSetState($idExit, 128) ; Exit - Menuitem will be greyed out _CropAndOCR() TrayItemSetState($idCrop, 64) ; Crop - Menuitem will be enabled TrayItemSetState($idExit, 64) ; Exit - Menuitem will be enabled Case $idExit ; Exit the loop. ExitLoop EndSwitch WEnd DllClose($user32) _GDIPlus_Shutdown() TrayTip("OCR by crop", "End of the 'TSR' OCR by crop", 3, 1) ; (1) = Info icon Sleep(3000) Exit Func _CropAndOCR() $aRect = _Crop() ; mark the area If Not @extended Then ; if the ESC key was pressed within the _Crop function the @extended is set to 1 Local $hTimer = TimerInit() Local $hBmp = _ScreenCapture_Capture('', $aRect[0], $aRect[1], $aRect[0] + $aRect[2] - 1, $aRect[1] + $aRect[3] - 1, False) Local $hBitmap = _GDIPlus_BitmapCreateFromHBITMAP($hBmp) Local $sOCRTextResult = _UWPOCR_GetText($hBitmap, Default, True) _WinAPI_DeleteObject($hBmp) _GDIPlus_BitmapDispose($hBitmap) MsgBox(0, "Time Elapsed: " & TimerDiff($hTimer), $sOCRTextResult) Return $sOCRTextResult EndIf EndFunc ;==>_CropAndOCR1 point
-
I'm not sure if this is still an issue for you, but if it is, then I have found that the following works for me on Windows 7 & 10. I haven't tested it on any other OS versions. As you can see on the MCI Play command page, you can use the "fullscreen" flag to play compressed video in fullscreen mode. When I added the flag to the "play" command, my video was played in fullscreen and stretched to the appropriate dimensions. I just changed the line that initiates the playing of the video from ... mciSendString("play myMedia") TO mciSendString("play myMedia fullscreen") Hopefully, it works for you too. P.S. To toggle between fullscreen and normal, you should be able to just reissue the play command with appropriate "from" position, with or without the "fullscreen" flag, as needed.1 point
-
Well, hope you don't mind giving you some of my comments... 1- You should not use those HotKeySet when it relates to a specific GUI that you have created on your own. Use GUISetAccelerators which it is way more robust. 2- You should not presume how the GUI was created. You should get the styles first, then change it. On resume you should put back the original styles. 3- Why not using @DesktopHeight/Width instead of this Shell_TrayWnd calculation. Unless you want to manage multiple display screens, which will not work anyway... 4- You should not use reference of functions in quotes; use it as is, makes your au3check more reliable. 5- You should use Local Static instead of Global when the only reference is within a single function.1 point
-
The "OpenWith" Command Doesn't Work on Win11.
Zedna reacted to argumentum for a topic
#include <WinAPIDlg.au3> _WinAPI_ShellOpenWithDlg ( $sFilePath [, $iFlags = 0 [, $hParent = 0]] )1 point -
It works if you re-enable the legacy context menus (it does for me anyway). reg.exe add "HKCU\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32" /f /ve1 point