Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/11/2021 in all areas

  1. _ArrayUnique() is your friend, see help.
    1 point
  2. This work is entirely based on tools created by MrCreatoR. One of this tools formats the code in the code box. The goal is to make it look like the AutoIt help file. Some fine tuning is still needed. As soon as I find some spare time I will have a look.
    1 point
  3. Hi, I need some time to digest this.... Just wanted to thank you guys for taking your time.
    1 point
  4. Yea right ... copied the wrong line in my answer ...
    1 point
  5. Try this : #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### $Form1_1 = GUICreate("Form1", 372, 218, 192, 124) GUISetBkColor(0x008080) $idUsername = GUICtrlCreateInput("Username", 35, 56, 305, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_CENTER)) $idUseremail = GUICtrlCreateInput("email", 35, 84, 305, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_CENTER,$ES_LOWERCASE,$ES_READONLY)) $idPassword = GUICtrlCreateInput("password", 35, 112, 305, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_CENTER)) $Computer = GUICtrlCreateLabel("Computer Setup", 80, 8, 213, 34) GUICtrlSetFont(-1, 18, 400, 0, "Showcard Gothic") $Exit = GUICtrlCreateButton("Exit", 216, 168, 123, 25) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $idUsername GUICtrlSetData($idUseremail, GUICtrlRead($idUsername) & "@email.com") Case $Exit Exit EndSwitch WEnd Edit : @anutt217 Explanation : GUICtrlCreateInput returns a controlID on success, not the data (in this case e.g. not the 'username') itself. To read or set the data you have to use GUICtrlRead or GUICtrlSetData.
    1 point
  6. In this case you have to use two separate bitmaps. 1st one is the background, 2nd one the blurred rectangle. Then copy 2nd bitmap over 1st bitmap. Something like this here: #include <GUIConstantsEx.au3> #include <GDIPlus.au3> #include <InetConstants.au3> #include <WinApi.au3> Local $hForm = GUICreate('', 300, 160) Local $iPic1 = GUICtrlCreatePic('', 20, 20, 140, 140) Local $iPic2 = GUICtrlCreatePic('', 160, 20, 140, 140) GUICtrlSetResizing($iPic1, $GUI_DOCKALL) GUICtrlSetResizing($iPic2, $GUI_DOCKALL) _GDIPlus_Startup() Local $hImage_net = _GDIPlus_BitmapCreateFromMemory(InetRead("https://www.webfx.com/blog/images/cdn.designinstruct.com/files/235-stars_pattern_textures/stars_pattern_texture_12_orange_orange_duo_preview.jpg")) Local $hImage_resized = _GDIPlus_ImageResize($hImage_net, 120, 120) _GDIPlus_ImageDispose($hImage_net) ; Left rectangle. Pouring on transparency Local $hImage1 = _GDIPlus_BitmapCreateFromScan0(120, 120, $GDIP_PXF32ARGB) Local $hGraphic = _GDIPlus_ImageGetGraphicsContext($hImage1) Local $hBrush = _GDIPlus_BrushCreateSolid(0xFFFF0000) _GDIPlus_GraphicsFillRect($hGraphic, 20, 20, 80, 80, $hBrush) _GDIPlus_GraphicsDispose($hGraphic) Local $hImage1_blurred = Blur_Simple($hImage1) ;~ Local $hEffect = _GDIPlus_EffectCreateBlur(10) ;~ _GDIPlus_BitmapApplyEffect($hImage1, $hEffect) ;~ _GDIPlus_EffectDispose($hEffect) $hGraphic = _GDIPlus_ImageGetGraphicsContext($hImage_resized) _GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage1_blurred, 0, 0, 120, 120) _GDIPlus_GraphicsDispose($hGraphic) ;Right rectangle. Filling in color Local $hImage2 = _GDIPlus_BitmapCreateFromScan0(120, 120, $GDIP_PXF32ARGB) $hGraphic = _GDIPlus_ImageGetGraphicsContext($hImage2) _GDIPlus_GraphicsClear($hGraphic, 0xFFF0F0F0) _GDIPlus_GraphicsFillRect($hGraphic, 20, 20, 80, 80, $hBrush) _GDIPlus_GraphicsDispose($hGraphic) Local $hEffect = _GDIPlus_EffectCreateBlur(10) _GDIPlus_BitmapApplyEffect($hImage2, $hEffect) _GDIPlus_EffectDispose($hEffect) Local $hBitmap1 = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage_resized) Local $hBitmap2 = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage2) GUICtrlSendMsg($iPic1, 0x0172, 0, $hBitmap1) GUICtrlSendMsg($iPic2, 0x0172, 0, $hBitmap2) _WinAPI_DeleteObject($hBitmap1) _WinAPI_DeleteObject($hBitmap2) _GDIPlus_ImageDispose($hImage1_blurred) _GDIPlus_ImageDispose($hImage2) _GDIPlus_ImageDispose($hImage2) GUISetState() Do Until GUIGetMsg() = $GUI_EVENT_CLOSE _GDIPlus_Shutdown() Func Blur_Simple($hBitmap, $iBlur = 0.09, $iInterpolationMode = 0) Local Const $iSW = _GDIPlus_ImageGetWidth($hBitmap), $iSH = _GDIPlus_ImageGetHeight($hBitmap) Local Const $fDW = $iSW / $iBlur, $fDH = $iSH / $iBlur Local Const $hBmp1 = _GDIPlus_BitmapCreateFromScan0($fDW, $fDH) Local $hCtx = _GDIPlus_ImageGetGraphicsContext($hBmp1) _GDIPlus_GraphicsSetInterpolationMode($hCtx, $iInterpolationMode) _GDIPlus_GraphicsDrawImageRectRect($hCtx, $hBitmap, 0, 0, $fDW, $fDH, 0, 0, $iSW, $iSH) _GDIPlus_GraphicsDispose($hCtx) Local Const $hBmp2 = _GDIPlus_BitmapCreateFromScan0($iSW, $iSH) _GDIPlus_GraphicsSetInterpolationMode($hCtx, $iInterpolationMode) $hCtx = _GDIPlus_ImageGetGraphicsContext($hBmp2) _GDIPlus_GraphicsDrawImageRectRect($hCtx, $hBmp1, 0, 0, $iSW, $iSH, 0, 0, $fDW, $fDH) _GDIPlus_GraphicsDispose($hCtx) _GDIPlus_BitmapDispose($hBmp1) Return $hBmp2 EndFunc Result:
    1 point
  7. wcook509

    Adventure Game

    I have renamed this project to "Stranded.au3" and decided that I am pretty much finished. The game can now be played to a conclusion. Either you solve it, die of hunger, thirst, exhaustion, or you give up and quit. I've learned a great deal from this exercise and have sprinkled in code I found on these forums to help accomplish what I wanted the script to do. If you ever played and old DOS text adventure games, you might find this interesting....Enjoy! Stranded.au3
    1 point
  8. water

    Excel write array

    Modify the _Excel_RangeWrite statement to _Excel_RangeWrite($oWorkbook, $oWorkbook.Activesheet, $aReturn, "a1", Default, True)
    1 point
  9. MaxGom

    Mouse click problem

    I have finally found the solution to my problem. It turns out that, if a program, in this case the BMS Troubleshooting tool program, has a different administrator privilege than AutoIt, any mouse clicks and send keys command from AutoIt to control the BMS window simply won't work. I gave the BMS program the same administrator privilege as AutoIt and that worked well. Anyway, I thank all those who have helped me here and thank you for your patience as well. I think we can consider this thread as close. Luv ya.
    1 point
  10. when i use _Excel_Close it still leaves the process running in the background. in most cases that wouldnt be an issue, but i have a script that opens a file in Excel, gets info, closes the file, THEN i need to open the same file with LibreOffice to convert it to PDF (because Excel does a crappy job when it comes to saving as PDF) but the file is still "in use" my heavy handed solution to this was _Excel_Close($oApp) ProcessClose("Excel.exe") but i will also try what MikahS suggested.
    1 point
  11. I guess that the loop statement that you need is: For ... Next or For ... In ... Next for example: $array = _FileListToArray() For $i = 1 to $array[0] statements Next Edit: your code could work if you start with $i = 1 as initialisation variable. In the loop you can use the variable $i to acces the array element with $array[$i]
    1 point
×
×
  • Create New...