Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/07/2024 in all areas

  1. I made some time ago a random theme generator. It generates random colors, put them in the clipboard and you have to paste them into the SciTEUser.properties file. You have to install "IBM Plex Mono" font to look exactly like the image. Here it is. Maybe someone find it interesting. gen_teme.au3
    3 points
  2. Hi everybody As of June 2024, Google translates 133 languages, as indicated in this Wikipedia link These 133 languages are found in the script, but if a user would like to display less than 133 languages in both combobox lists (i.e. "language from", "language to") then I added some code to easily achieve this. The following image shows a combobox containing 133 languages, so the user has to scroll up and down to retrieve the language he needs (or the user can type the 1st letter of the language he needs and cycle by typing again etc...) A click on the mysterious button (labeled "?") will display a temporary GUI where you can Uncheck All languages, then check the ones you really need. Here is an example where 4 languages are checked : Here is the result : now the combobox shows only 4 languages, no scrolling required anymore. After that, If you want to add more languages, or delete some, just press any time the mysterious button "?" For the record, on Windows 10, the number of items displayed in a combobox (before a vertical scrollbar appears) is 30, so if you want to avoid a vertical scrollbar and click directly on the language used for translation, then 30 seems an interesting choice. The list of the checked languages will be preserved during sessions (it is written in the .ini file) . For those who upgrade the script from a precedent version, you'll be warned that your actual ini file is not compatible with the new script. No big deal, it will be deleted automatically, then recreated correctly when you run the new script a 2nd time. The updated script (version 7) is found in the 1st post of this thread. Please indicate if you found any problem. Have a great day
    2 points
  3. Werty

    SlideShow Image

    SlideShow Image Buttons will be grayed out on the first runthrough and enabled when done, interval between images on the first run will depend on the speed of your computer (only a few seconds on my computer). ;https://www.autoitscript.com/forum/topic/211958-slideshow-image/ #include <GDIPlus.au3> HotKeySet("{ESC}", "_exit") Global $Image[4], $Current = 3 _GDIPlus_Startup () $Image[0] = _GDIPlus_BitmapCreateFromFile ("SlideShowImage0.png") $Width = _GDIPlus_ImageGetWidth ($Image[0]) $Height = _GDIPlus_ImageGetHeight ($Image[0]) $Canvas = _GDIPlus_BitmapCreateFromScan0($Width, $Height, $GDIP_PXF32ARGB) $Gui = GUICreate("SlideShow Image", $Width, $Height+30) $Prev = GUICtrlCreateButton("<", $Width/2-50, $Height+2, 50, 26) $Next = GUICtrlCreateButton(">", $Width/2+50, $Height+2, 50, 26) GUISetState() $Graphics = _GDIPlus_GraphicsCreateFromHWND($Gui) _GDIPlus_GraphicsDrawImageRect ($Graphics, $Image[0], 0, 0, $Width, $Height) If Not FileExists("SlideShowImage1.png") Then GUICtrlSetState($Prev, 128) GUICtrlSetState($Next, 128) For $Loop = 0 To 2 $Bitmap = _GDIPlus_BitmapLockBits($Image[0], 0, 0, $Width, $Height, BitOR($GDIP_ILMWRITE, $GDIP_ILMREAD), $GDIP_PXF32ARGB) $Pixels = DllStructCreate("dword[" & $Width * $Height & "];", DllStructGetData($Bitmap, "Scan0")) $Bitmap2 = _GDIPlus_BitmapLockBits($Canvas, 0, 0, $Width, $Height, BitOR($GDIP_ILMWRITE, $GDIP_ILMREAD), $GDIP_PXF32ARGB) $Pixels2 = DllStructCreate("dword[" & $Width * $Height & "];", DllStructGetData($Bitmap2, "Scan0")) For $x = 0 To $Width * $Height DllStructSetData($Pixels2, 1, "0xFF" & _ Hex(BitAnd(BitShift(DllStructGetData($Pixels, 1, $x), $Loop+16), 1)*255, 2) & _ Hex(BitAnd(BitShift(DllStructGetData($Pixels, 1, $x), $Loop+8), 1)*255, 2) & _ Hex(BitAnd(BitShift(DllStructGetData($Pixels, 1, $x), $Loop), 1)*255, 2), $x) Next _GDIPlus_BitmapUnlockBits($Image[0], $Bitmap) _GDIPlus_BitmapUnlockBits($Canvas, $Bitmap2) $Blur = _GDIPlus_EffectCreateBlur(2) For $Loop2 = 0 To 3 _GDIPlus_ImageRotateFlip($Canvas, 1) _GDIPlus_BitmapApplyEffect($Canvas, $Blur) Next _GDIPlus_GraphicsDrawImageRect ($Graphics, $Canvas, 0, 0, $Width, $Height) _GDIPlus_ImageSaveToFile($Canvas, "SlideShowImage" & $Loop+1 & ".png") Next Else _GetImages() EndIf _GetImages() GUICtrlSetState($Prev, 64) GUICtrlSetState($Next, 64) While 1 Switch GUIGetMsg() Case - 3 Exit Case $Next $Current += 1 If $Current > 3 Then $Current = 0 _ShowImage($Current) Case $Prev $Current -= 1 If $Current < 0 Then $Current = 3 _ShowImage($Current) EndSwitch WEnd Func _GetImages() For $i = 1 To 3 $Image[$i] = _GDIPlus_BitmapCreateFromFile("SlideShowImage" & $i & ".png") Next EndFunc Func _ShowImage($Current) _GDIPlus_GraphicsDrawImageRect ($Graphics, $Image[$Current], 0, 0, $Width, $Height) EndFunc Func _exit() Exit EndFunc SlideShowImage.zip
    1 point
  4. ...already did
    1 point
  5. AspirinJunkie

    Regex help please

    Another suggestion: Global $sTxt = _ '<a href="some-folder/2021-abc/somefile"> ' & @CRLF & _ '<a href="some-folder/2021-abc/somefile-123"> ' & @CRLF & _ '<a href="some-folder/2022-abc/1234"> ' & @CRLF & _ '<a href="some-folder/2022-abc/1234-somefile"> ' & @CRLF & _ '<a href="fake"> ' & @CRLF & _ '<a href="some-folder/2023-abc/123-somefile-456"> ' & @CRLF & _ '<a href="some-folder/another-folder/2024-abc/789-somefile-456">' & @CRLF $sProcessed = StringRegExpReplace($sTxt, '<a\b[^>]+href="\K[^"]+?\/(?=\d[^\/"]+")', '###') ConsoleWrite($sProcessed)
    1 point
  6. benners

    Regex help please

    This perhaps? $replace = StringRegExpReplace($string, '<a href="[^/]+/[^/]+/(\d[^/]*?)">', '<a href="' & $code & '$1">') Or for more folder segments $replace = StringRegExpReplace($string, '<a href="(?:[^/]+/)*(\d[^/]*?)">', '<a href="' & $code & '$1">')
    1 point
×
×
  • Create New...