Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/12/2013 in all areas

  1. Hi! I did this UDF for me (and you ). It tests while typing if the text entered to an input filed (should work with edit too) is atm fitting into a given RegExp or if it still can fullfill it. How to use: To start it up, you use: _RegEx_RestrictControl_setup (20) ; prepare for up to 20 Controls to restrictoÝ÷ Ù'­¶)àj·¬¶¸¶*'¢v¢{k¢X¬vÞjdz&¬¶¬jëh×6$inp = GUICtrlCreateInput("", 10, 10, 100, 20) _RegEx_RestrictControl_add ($inp, "^[a-z]{0,10}$") ; up to 10 letters $inp2 = GUICtrlCreateInput("", 10, 200, 100, 20) _RegEx_RestrictControl_add ($inp2, "^[a-zA-Z_0-9]{1,20}@[a-zA-Z_0-9]{2,20}.[a-z]{2,4}$", "g@gm.de") ; e-mail-addressoÝ÷ Ø2¢ë{*.+Þ¶¢{k¢R~*ì¶Ø^Ø^­ë-®'-Ñz1¥©Ý«-jö¥Û-®)à~âµ8^½©bvËkxjvÞ¢h­µçb~Ø^EèƬ~ée~)eyÖ¥Ø^¶)Â¥zÜ©x~z-Ê ÷­+Ûay@Åi×lj|¬¹»-®)à¡ø­~º&¶Ûh¶ººÞ×(Úèlµìmjwç$²Ø^EèÆazp'vÜ¢êì±ì¨ºwvÚ"ÉnuëaÆ­¶­¢Ê«±Êâ¦Ö¬²é¢©Ý±Êâ¦Ö«z)íëçb­«­¢+Ø¥¹±ÕÅÕ½ÐíIÍÑÉ¥Ñ ½¹Ñɽ±IáÀ¹ÔÌÅÕ½ÐìoÝ÷ Ù8^~ée²«q殶­sc²ÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓУ°£²TDbæÖS¢&W7G&7D6öçG&öÅ&VtWæS2£²FW67&Föã¢F2TDb6â&W7G&7BFRFWBGVBçFòçWB6öçG&öÇ2ÆfR£²vÆRGær&6VBöâvfVâ&VwVÆ"W&W76öâࣲ&WV&VÖVçC¢WFôB2ã"ãã÷"vW £²WF÷#¢VWFV&VRVWFV&VTv×æFRÂGG¢ò÷wwræWFöBæFR£²æ÷F6S¢&6VBöâ67&B'vg&÷7BâF2F&VC¢£²GG¢ò÷wwræWFöG67&Bæ6öÒöf÷'VÒöæFWç÷6÷wF÷3Ó3SSbf׶ÃÖwV&Vv7FW&×6p£°£²ÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÐ ¢6æ6ÇVFRfÇC´wV6öç7FçG2æS2fwC° ¤vÆö&Â6öç7Bb33cµtÕô4ôÔÔäBÒ¤vÆö&Â6öç7Bb33c´Tåô4ätRÒ3 ¤vÆö&Âb33c¶'&õõ&VtWõ&W7G&7D6öçG&öųճEФvÆö&Âb33c¶'&õõ&VtWõ&W7G&7D6öçG&öÅöEö6÷VçBÒ £³ÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓУ°£²gVæ7FöâæÖS¢õ&VtWõ&W7G&7D6öçG&öÅ÷6WGW£²FW67&Föã¢6WG2WFRfVGW&W2öbF2TDb⣲&ÖWFW"2¢b33cµ÷&U÷&5öÖö6öçG&öÇ2÷÷FöæÂÂFVfVÇB£²FVfæW2÷rÖç6öçG&öÇ2vâ&R6öçG&öÆÆVBBÖ×VУ²&WV&VÖVçB2¢F2TDbæ6ÇVFV@£²&WGW&âfÇVR2¢æöæRࣲWF÷"2¢VWFV&VP£°£³ÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓФgVæ2õ&VtWõ&W7G&7D6öçG&öÅ÷6WGWb33cµ÷&U÷&5öÖö6öçG&öÇ2Ò¢uT&Vv7FW$×6rb33cµtÕô4ôÔÔäBÂgV÷Cµõ&VtWõ&W7G&7D6öçG&öÅö6V6²gV÷C²¢&TFÒb33c¶'&õõ&VtWõ&W7G&7D6öçG&öŲb33cµ÷&U÷&5öÖö6öçG&öÇ5Õ³EТb33c¶'&õõ&VtWõ&W7G&7D6öçG&öÅöEö6÷VçBÒ¤VæDgVæ2³ÓÒfwCµõ&VtWõ&W7G&7D6öçG&öÅ÷6WGW £³ÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓУ°£²gVæ7FöâæÖS¢õ&VtWõ&W7G&7D6öçG&öÅöF@£²FW67&Föã¢6WG2WFR6öçG&öÆÆærf÷"6öçG&öÂ⣲&ÖWFW"2¢b33cµ÷&U÷&5ö7G&Æ@£²BöbFR6öçG&öÂFò&RÖöæF÷&V@£²b33cµ÷&U÷&5÷&VvW÷GFW&ࣲ&VtWv62Fò&RgVÆÆfÆÆVB÷"gVÆÆfÆÆ&ÆP£²b33cµ÷&U÷&5÷fÆE÷7G&ær÷FöæÂÂFVfVÇBgV÷C²gV÷C²£²fÆB7G&ærf÷"FW7Færb&VtW6â7FÆÂ&RgVÆÆfÆÆVBࣲ&WV&VÖVçB2¢F2TDbæ6ÇVFV@£²&WGW&âfÇVR2¢æöæRࣲWF÷"2¢VWFV&VP£°£³ÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓФgVæ2õ&VtWõ&W7G&7D6öçG&öÅöFBb33cµ÷&U÷&5ö7G&ÆBÂb33cµ÷&U÷&5÷&VvW÷GFW&âÂb33cµ÷&U÷&5÷fÆE÷7G&ærÒgV÷C²gV÷C²¢b33c¶'&õõ&VtWõ&W7G&7D6öçG&öŲb33c¶'&õõ&VtWõ&W7G&7D6öçG&öÅöEö6÷VçEÕ³ÒÒb33cµ÷&U÷&5ö7G&Æ@¢b33c¶'&õõ&VtWõ&W7G&7D6öçG&öŲb33c¶'&õõ&VtWõ&W7G&7D6öçG&öÅöEö6÷VçEÕ³ÒÒb33cµ÷&U÷&5÷&VvW÷GFW&à¢b33c¶'&õõ&VtWõ&W7G&7D6öçG&öŲb33c¶'&õõ&VtWõ&W7G&7D6öçG&öÅöEö6÷VçEÕ³%ÒÒb33cµ÷&U÷&5÷fÆE÷7G&æp¢b33c¶'&õõ&VtWõ&W7G&7D6öçG&öŲb33c¶'&õõ&VtWõ&W7G&7D6öçG&öÅöEö6÷VçEÕ³5ÒÒgV÷C²gV÷C°¢b33c¶'&õõ&VtWõ&W7G&7D6öçG&öÅöEö6÷VçB³Ò¤VæDgVæ2³ÓÒfwCµõ&VtWõ&W7G&7D6öçG&öÅöF@ £³ÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓУ°£²gVæ7FöâæÖS¢õ&VtWõ&W7G&7D6öçG&öÅö6V6°£²FW67&Föã¢çFW&æÂ&ö6W76ærgVæ7FöâÒæ÷BFò&R6ÆÆVBg&öÒ÷WG6FRb333°£²&ÖWFW"2¢²ââåУ²&WV&VÖVçB2¢F2TDbæ6ÇVFV@£²&WGW&âfÇVR2¢æöæRࣲWF÷"2¢VWFV&VRW6ærvg&÷7Bb33·2v÷&²2&62£°£³ÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓФgVæ2õ&VtWõ&W7G&7D6öçG&öÅö6V6²b33c¶væBÂb33c¶×6rÂb33c·u&ÒÂb33c¶Å&Ò¢Æö6Âb33c¶äæ÷Fg6öFRÒôv÷&Bb33c·u&Ò¢Æö6Âb33c¶äBÒôÆõv÷&Bb33c·u&Ò¢Æö6Âb33c¶7G&ÂÒb33c¶Å&Ð £·â×6t&÷ÂgV÷C²gV÷C²ÂT&÷VæBb33c¶'&õõ&VtWõ&W7G&7D6öçG&ö¢f÷"b33cµ÷&U÷&5öÒFòT&÷VæBb33c¶'&õõ&VtWõ&W7G&7D6öçG&öÂÂÒ¢bb33c¶äBÒb33c¶'&õõ&VtWõ&W7G&7D6öçG&öŲb33cµ÷&U÷&5öÕ³ÒFVà¢bb33c¶äæ÷Fg6öFRÒb33c´Tåô4ätRFVࢲ6V6²&VtWæB6WBFW@¢f÷"b33cµ÷&U÷&5ö¢ÒFò7G&ætÆVâb33c¶'&õõ&VtWõ&W7G&7D6öçG&öŲb33cµ÷&U÷&5öÕ³%Ò¢b33cµ÷&U÷&5÷&VvW÷&W2Ò£·â×6t&÷ÂgV÷C·&VvW7G&ærgV÷C²ÂuT7G&Å&VBb33c¶'&õõ&VtWõ&W7G&7D6öçG&öŲb33cµ÷&U÷&5öÕ³Òfײ7G&æuG&ÔÆVgBb33c¶'&õõ&VtWõ&W7G&7D6öçG&öŲb33cµ÷&U÷&5öÕ³%ÒÂb33cµ÷&U÷&5ö¢¢b7G&æu&VtWuT7G&Å&VBb33c¶'&õõ&VtWõ&W7G&7D6öçG&öŲb33cµ÷&U÷&5öÕ³Òfײ7G&æuG&ÔÆVgBb33c¶'&õõ&VtWõ&W7G&7D6öçG&öŲb33cµ÷&U÷&5öÕ³%ÒÂb33cµ÷&U÷&5ö¢Âb33c¶'&õõ&VtWõ&W7G&7D6öçG&öŲb33cµ÷&U÷&5öÕ³ÒFVâWDÆö÷¢b33cµ÷&U÷&5÷&VvW÷&W2Ò¢æW@¢bb33cµ÷&U÷&5÷&VvW÷&W2ÒFVࢲ6fR7G&ær2gV÷C¶vööBgV÷C²fÇVRf÷"ÆFW"&W6WGF&ÆG¢b33c¶'&õõ&VtWõ&W7G&7D6öçG&öŲb33cµ÷&U÷&5öÕ³5ÒÒuT7G&Å&VBb33c¶'&õõ&VtWõ&W7G&7D6öçG&öŲb33cµ÷&U÷&5öÕ³Ò¢VÇ6P¢²&W6WBFWBFòÆ7B¶æ÷vâvööBfÇVP¢uT7G&Å6WDFFb33c¶'&õõ&VtWõ&W7G&7D6öçG&öŲb33cµ÷&U÷&5öÕ³ÒÂb33c¶'&õõ&VtWõ&W7G&7D6öçG&öŲb33cµ÷&U÷&5öÕ³5Ò¢VæD`¢VæD`¢VæD`¢æW@¢²&ö6VVBFRFVfVÇBWFöC2çFW&æÂÖW76vR6öÖÖæG2ࢲ÷RÇ6ò6â6ö×ÆWFRÆWBFRÆæR÷WBࢲb333²b333²b333²'WBöæÇb33µ&WGW&âb33²vF÷WBçfÇVRvÆÂæ÷B&ö6VV@¢²FRFVfVÇBWFöC2ÖÖW76vRâFRgWGW&Rb333²b333²b333°¢&WGW&âb33c´uTõ%TäDTdÕ4p¤VæDgVæ2³ÓÒfwCµõ&VtWõ&W7G&7D6öçG&öÅö6V6° £²VÇærgVæ7Föâ'vg&÷7@¤gVæ2ôv÷&Bb33c·¢&WGW&â&E6gBb33c·Âb¤VæDgVæ2³ÓÒfwCµôv÷&@ £²VÇærgVæ7Föâ'vg&÷7@¤gVæ2ôÆõv÷&Bb33c·¢&WGW&â&DäBb33c·Âdddb¤VæDgVæ2³ÓÒfwCµôÆõv÷& Have fun with that one! Full source of a little test app is attached. peethebee RestrictControlRegExp.au3 RestrictControlRegExp_test.au3
    1 point
  2. UEZ

    Trasparency Problems

    Indeed, the code box is broken! Here the code from that link: ;http://www.autoitscript.com/forum/index.php?showtopic=93706 ;=============================================================================== ; ; Function Name: ; _DrawTransparentEllipse ; Description:: Let you draw a transparent Ellipse ; Parameter(s): ; $hwnd - Handle of GUI to work on ; $x - Postion x of the Ellipse ; $y - Postion y of the Ellipse ; $w - Width of the Ellipse ; $h - Height of the Ellipse, If w=h it will be a circle. ; $Transparency - Set Transparancy of GUI ( optional ) ; $EllipseBorderColor - A Border Color if you want =) ( optional ) ; Requirement(s): Layered Windows ; Return Value(s): ControlID of the Form ; Author(s): Greek, martin ; Example : Yes ;=============================================================================== ;=============================================================================== ; ; Function Name: ; _DrawTransparentRect ; Description:: Let you draw a transparent Rect ; Parameter(s): ; $hwnd - Handle of GUI to work on ; $x - Postion x of the Rect ; $y - Postion y of the Rect ; $w - Width of the Rect ; $h - Height of the Rect, If w=h it will be a square. ; $Transparency - Set Transparancy of GUI ( optional ) ; $RectBorderColor - A Border Color if you want =) ( optional ) ; Requirement(s): Layered Windows ; Return Value(s): ControlID of the Form ; Author(s): Greek, martin ; Example : Yes ;=============================================================================== ;=============================================================================== ; ; Function Name: _DrawTransparentLine ; Description:: Let you draw a transparent Line ; Parameter(s): ; $hwnd - Handle of GUI to work on ; $x - Postion x of the Line ; $y - Postion x of the Line ; $length - Postion x of the Line ; $course - Postion x of the Line ; $pensize - The pensize, default is 2 ( optional ) ; $Transparency - Set Transparancy of GUI ( optional ) ; Requirement(s): Layered Windows ; Return Value(s): ControlID of the Form ; Author(s): Greek, martin ; Example : Yes ;=============================================================================== ;=============================================================================== ; ; Function Name: _DeletTransparentForm ; Description:: Delet the Form ; Parameter(s): ; $Form - controlID of the Form ; Return Value(s): Success: Returns 1. ; Failure: Returns 0. ; Author(s): Greek, martin ;=============================================================================== #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $gui=GUICreate ( "Transparent Ellipse and Rect", 420, 500, @DesktopWidth/2-300, @DesktopHeight/2-300, $WS_POPUP, $WS_EX_LAYERED ) GUISetBkColor ( 0x000000 ) GUICtrlCreateLabel("", 0, 0, 420, 500, -1, $GUI_WS_EX_PARENTDRAG) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUISetState () _DrawTransparentLine ( $gui, 50, 400, 300, 0) _DrawTransparentEllipse ( $gui, 20, 20, 150, 100 ) _DrawTransparentEllipse ( $gui, 250, 20, 150, 100, 255, 0xFF0000 ) _DrawTransparentRect ( $gui, 20, 200, 150, 150 ) _DrawTransparentRect ( $gui, 250, 200, 150, 150, 255, 0x0000FF ) While 1 $msg=GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func _DeletTransparentForm ( $Form ) $a=GUICtrlDelete ( $Form ) Return $a EndFunc Func _DrawTransparentLine($hwnd, $X,$Y,$length,$course,$pensize=2,$Transparency=255) _WinAPI_SetLayeredWindowAttributes($hwnd, 0xABCDEF, $Transparency) $g1=GUICtrlCreateGraphic($X,$Y,0,0) GUICtrlSetGraphic($g1, $GUI_GR_PENSIZE, $pensize ) GUICtrlSetGraphic($g1, $GUI_GR_COLOR,0xABCDEF, 0xABCDEF) GUICtrlSetGraphic($g1, $GUI_GR_LINE, $length, $course) GUICtrlSetGraphic($g1, $GUI_GR_REFRESH) GUICtrlSetGraphic($g1, $GUI_GR_LINE, 1, 1) Return $g1 EndFunc Func _DrawTransparentRect($hwnd, $x,$y,$w,$h,$Transparency=255, $RectBorderColor=0xABCDEF) _WinAPI_SetLayeredWindowAttributes($hwnd, 0xABCDEF, $Transparency) $g1=GUICtrlCreateGraphic(0,0,0,0) GUICtrlSetGraphic($g1, $GUI_GR_COLOR,$RectBorderColor, 0xABCDEF) GUICtrlSetGraphic($g1, $GUI_GR_RECT, $x, $y, $w, $h) GUICtrlSetGraphic($g1, $GUI_GR_REFRESH) GUICtrlSetGraphic($g1, $GUI_GR_LINE, 1, 1) Return $g1 EndFunc Func _DrawTransparentEllipse($hwnd, $x,$y,$w,$h,$Transparency=255,$EllipseBorderColor=0xABCDEF) _WinAPI_SetLayeredWindowAttributes($hwnd, 0xABCDEF, $Transparency) $g1=GUICtrlCreateGraphic(0,0,0,0) GUICtrlSetGraphic($g1, $GUI_GR_COLOR,$EllipseBorderColor, 0xABCDEF) GUICtrlSetGraphic($g1, $GUI_GR_ELLIPSE, $x, $y, $w, $h) GUICtrlSetGraphic($g1, $GUI_GR_REFRESH) GUICtrlSetGraphic($g1, $GUI_GR_LINE, 1, 1) Return $g1 EndFunc Func _WinAPI_SetLayeredWindowAttributes($hwnd, $i_transcolor, $Transparency = 255, $dwFlages = 0x03, $isColorRef = False) ; progandy If $dwFlages = Default Or $dwFlages = "" Or $dwFlages < 0 Then $dwFlages = 0x03 If Not $isColorRef Then $i_transcolor = Hex(String($i_transcolor), 6) $i_transcolor = Execute('0x00' & StringMid($i_transcolor, 5, 2) & StringMid($i_transcolor, 3, 2) & StringMid($i_transcolor, 1, 2)) EndIf Local $Ret = DllCall("user32.dll", "int", "SetLayeredWindowAttributes", "hwnd", $hwnd, "long", $i_transcolor, "byte", $Transparency, "long", $dwFlages) Select Case @error Return SetError(@error, 0, 0) Case $Ret[0] = 0 Return SetError(4, _WinAPI_GetLastError(), 0) Case Else Return 1 EndSelect EndFunc ;==>_WinAPI_SetLayeredWindowAttributes Func _WinAPI_GetLastError() Local $aResult $aResult = DllCall("Kernel32.dll", "int", "GetLastError") If @error Then Return SetError(@error, 0, 0) Return $aResult[0] EndFunc ;==>_WinAPI_GetLastError Br, UEZ
    1 point
  3. You are not running the latest production version of Obfuscator which has the /MO support. Did you install AutoIt3 in the standard "C:Program FilesAutoIt3" directory and does that have an Include subdirectory? First get the latest version and try again. ps. I now understand also why you did hide the name of the script in the original posted image ... Guess you are aware of our view on gamebots. "Pulpitogamebot" Jos
    1 point
  4. Again, There are several threads were it is explained how to use Obfuscator to merge all includes. This is what it comes down to: You first need to install the Full SciTE4AutoIt3 installerAdd this at the top of your script: #Obfuscator_Parameters= /moLook at the generated file called scriptname_Obfuscated.au3Jos
    1 point
  5. The extra lines come from #Include statements you use. Show us the script that is having the problem so we can have a look.
    1 point
  6. ... Don't care.... we have rules and they are there for a reason. This is not up for discussion. So. maybe it would help when you tell us what your error is?
    1 point
  7. Please read the Forum rules before posting again about decompilation as this is an illegal operation. As to your question, this topic has been discussed several times and you can use Obfuscator to merge all lines of the included files with your main script to get the proper line of the error. Of course you really should run the script from SciTE first to do test as that will give much better indication of issues. Jos
    1 point
  8. try: ShellExecute("Aut2exe.exe", ' /in "B:\Folder\Auto It\TestScript\Test\Test.au3"') jos
    1 point
  9. Tomoya, What you want to do is quite possible - I did it as a coding exercise myself some time ago. Just remember that you will need to FileInstall both Aut2Exe.exe and AutoItSC.bin if AutoIt is not installed on the user's machine. M23
    1 point
  10. Tomoya

    'Automating' the microphone

    You can use a combination of programs to do this. You can set up a virtual audio cable (VAC) and then set that as the received input for the program you use. A good way to get some videos and methods on this is to search Google for "Play music over Ventrio" or "Play music over TeamSpeak." While it's not the exact program you are looking for they will give you the guides to setting up a VAC and routing it into another program.
    1 point
  11. trancexx

    Recursion level limit

    Recursion limit is artificial. Jon did some testings and concluded that in order for AutoIt to function correctly in low memory coditions it would be good to use the numbers willichan shows. It's not machine specific, it's related to the bitness of the interpretter. x86 have one limit and x64 other. The problem with the numbers used before is that undrelying API couldn't load string resource (as docummented by MSDN) used for displaying the "error". This means that in reality these numbers could be set higher if the strings wouldn't be loaded from resources. Still the limit would also be reached at some point, so the question is really why to change it.
    1 point
  12. Sundance

    FreeImage Library

    Hi, did you try the BitOr function instead of the '&' sign?. _FreeImage_SaveU($FIF, $hImageResized, $Name & "_rsz"&$Ext, BitOR($JPEG_OPTIMIZE,$JPEG_SUBSAMPLING_422,$JPEG_QUALITYSUPERB))
    1 point
  13. UEZ

    FloodFill without direct GDI

    There is no fill function in GDI+, so I wrote one. Try this: #include <GDIPlus.au3> $sRegPath = "HKLM\SOFTWARE\AutoIt v3\AutoIt" If StringInStr("X64IA64", @OSArch) Then $sRegPath = StringReplace($sRegPath, "SOFTWARE", "SOFTWARE\Wow6432Node") _GDIPlus_Startup() $hImage = _GDIPlus_ImageLoadFromFile(RegRead($sRegPath, "InstallDir") & "\Examples\GUI\logo4.gif") $iColor2Fill = 0xFFFFFFFF ;~ _GDIPlus_FloodFill($hImage, 10, 10, 0xFF000080, 0xFFFFFF00) _GDIPlus_FloodFill($hImage, 73, 22, $iColor2Fill, 0xFFFFFF00) _GDIPlus_FloodFill($hImage, 88, 27, $iColor2Fill, 0xFFFFFF00) _GDIPlus_FloodFill($hImage, 99, 38, $iColor2Fill, 0xFFFFFF00) _GDIPlus_FloodFill($hImage, 109, 32, $iColor2Fill, 0xFFFFFF00) _GDIPlus_FloodFill($hImage, 120, 37, $iColor2Fill, 0xFFFFFF00) _GDIPlus_FloodFill($hImage, 120, 37, $iColor2Fill, 0xFFFFFF00) _GDIPlus_FloodFill($hImage, 141, 41, $iColor2Fill, 0xFFFFFF00) _GDIPlus_FloodFill($hImage, 153, 43, $iColor2Fill, 0xFFFFFF00) _GDIPlus_ImageSaveToFile($hImage, @ScriptDir & "\Filled.png") _GDIPlus_ImageDispose($hImage) _GDIPlus_Shutdown() ShellExecute(@ScriptDir & "\Filled.png") Exit Func _GDIPlus_FloodFillRec(ByRef $hBitmap, $iX, $iY, $iColorOld, $iColorNew) ;coded by UEZ 2013-01-12 Local Static $iRec = 1 Local $aResult = DllCall($ghGDIPDll, "uint", "GdipBitmapGetPixel", "handle", $hBitmap, "int", $iX, "int", $iY, "uint*", 0) If $aResult[4] = "0x" & Hex($iColorOld, 8) Then DllCall($ghGDIPDll, "uint", "GdipBitmapSetPixel", "handle", $hBitmap, "int", $iX, "int", $iY, "uint", $iColorNew) Else Return 0 EndIf Local $iRecLimit = 3899 $aResult = DllCall($ghGDIPDll, "uint", "GdipGetImageDimension", "handle", $hBitmap, "float*", 0, "float*", 0) If ($iX + 1) < $aResult[2] + 1 Then $iRec += 1 If $iRec = $iRecLimit Then Return -1 _GDIPlus_FloodFillRec($hBitmap, $iX + 1, $iY, $iColorOld, $iColorNew) ;go east $iRec -= 1 EndIf If ($iY + 1) < $aResult[3] + 1 Then $iRec += 1 If $iRec = $iRecLimit Then Return -1 _GDIPlus_FloodFillRec($hBitmap, $iX, $iY + 1, $iColorOld, $iColorNew) ;go south $iRec -= 1 EndIf If ($iX - 1) > -1 Then $iRec += 1 If $iRec = $iRecLimit Then Return -1 _GDIPlus_FloodFillRec($hBitmap, $iX - 1, $iY, $iColorOld, $iColorNew) ;go west $iRec -= 1 EndIf If ($iY - 1) > -1 Then $iRec += 1 If $iRec = $iRecLimit Then Return -1 _GDIPlus_FloodFillRec($hBitmap, $iX, $iY - 1, $iColorOld, $iColorNew) ;go north $iRec -= 1 EndIf Return 1 EndFunc ;==>_GDIPlus_FloodFillRec It will fill the white color insite the AutoIt logo with color yellow. Another example: #include <Memory.au3> #include <GDIPlus.au3> _GDIPlus_Startup() $hImage = _GDIPlus_BMPFromMemory(_ChristianClub()) _GDIPlus_FloodFill($hImage, 200, 200, 0xFFFFFFFF, 0xFF0000FF) _GDIPlus_ImageSaveToFile($hImage, @ScriptDir & "\Filled.png") _GDIPlus_BitmapDispose($hImage) _GDIPlus_Shutdown() ShellExecute(@ScriptDir & "\Filled.png") Exit Func _GDIPlus_FloodFillRec(ByRef $hBitmap, $iX, $iY, $iColorOld, $iColorNew) ;coded by UEZ 2013-01-12 Local Static $iRec = 1 Local $aResult = DllCall($ghGDIPDll, "uint", "GdipBitmapGetPixel", "handle", $hBitmap, "int", $iX, "int", $iY, "uint*", 0) If $aResult[4] = "0x" & Hex($iColorOld, 8) Then DllCall($ghGDIPDll, "uint", "GdipBitmapSetPixel", "handle", $hBitmap, "int", $iX, "int", $iY, "uint", $iColorNew) Else Return 0 EndIf Local $iRecLimit = 3899 $aResult = DllCall($ghGDIPDll, "uint", "GdipGetImageDimension", "handle", $hBitmap, "float*", 0, "float*", 0) If ($iX + 1) < $aResult[2] + 1 Then $iRec += 1 If $iRec = $iRecLimit Then Return -1 _GDIPlus_FloodFillRec($hBitmap, $iX + 1, $iY, $iColorOld, $iColorNew) ;go east $iRec -= 1 EndIf If ($iY + 1) < $aResult[3] + 1 Then $iRec += 1 If $iRec = $iRecLimit Then Return -1 _GDIPlus_FloodFillRec($hBitmap, $iX, $iY + 1, $iColorOld, $iColorNew) ;go south $iRec -= 1 EndIf If ($iX - 1) > -1 Then $iRec += 1 If $iRec = $iRecLimit Then Return -1 _GDIPlus_FloodFillRec($hBitmap, $iX - 1, $iY, $iColorOld, $iColorNew) ;go west $iRec -= 1 EndIf If ($iY - 1) > -1 Then $iRec += 1 If $iRec = $iRecLimit Then Return -1 _GDIPlus_FloodFillRec($hBitmap, $iX, $iY - 1, $iColorOld, $iColorNew) ;go north $iRec -= 1 EndIf Return 1 EndFunc ;==>_GDIPlus_FloodFillRec ;====================================================================================== ; Function Name: _GDIPlus_BMPFromMemory ; Description: Loads an image which is saved as a binary string and converts it to a bitmap or hbitmap ; ; Parameters: $bImage: the binary string which contains any valid image which is supported by GDI+ ; Optional: $hHBITMAP: if false a bitmap will be created, if true a hbitmap will be created ; ; Remark: hbitmap format is used generally for GUI internal images, $bitmap is more a GDI+ image format ; Don't forget _GDIPlus_Startup() and _GDIPlus_Shutdown() ; ; Requirement(s): GDIPlus.au3, Memory.au3 and _WinAPI_BitmapCreateDIBFromBitmap() from WinAPIEx.au3 ; Return Value(s): Success: handle to bitmap (GDI+ bitmap format) or hbitmap (WinAPI bitmap format), ; Error: 0 ; Error codes: 1: $bImage is not a binary string ; 2: unable to create stream on HGlobal ; 3: unable to create bitmap from stream ; ; Author(s): UEZ ; Additional Code: thanks to progandy for the MemGlobalAlloc and tVARIANT lines and ; Yashied for _WinAPI_BitmapCreateDIBFromBitmap() from WinAPIEx.au3 ; Version: v0.98 Build 2012-08-29 Beta ;======================================================================================= Func _GDIPlus_BMPFromMemory($bImage, $hHBITMAP = False) If Not IsBinary($bImage) Then Return SetError(1, 0, 0) Local $aResult Local Const $memBitmap = Binary($bImage) ;load image saved in variable (memory) and convert it to binary Local Const $len = BinaryLen($memBitmap) ;get length of image Local Const $hData = _MemGlobalAlloc($len, $GMEM_MOVEABLE) ;allocates movable memory ($GMEM_MOVEABLE = 0x0002) Local Const $pData = _MemGlobalLock($hData) ;translate the handle into a pointer Local $tMem = DllStructCreate("byte[" & $len & "]", $pData) ;create struct DllStructSetData($tMem, 1, $memBitmap) ;fill struct with image data _MemGlobalUnlock($hData) ;decrements the lock count associated with a memory object that was allocated with GMEM_MOVEABLE $aResult = DllCall("ole32.dll", "int", "CreateStreamOnHGlobal", "handle", $pData, "int", True, "ptr*", 0) ;Creates a stream object that uses an HGLOBAL memory handle to store the stream contents If @error Then Return SetError(2, 0, 0) Local Const $hStream = $aResult[3] $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateBitmapFromStream", "ptr", $hStream, "int*", 0) ;Creates a Bitmap object based on an IStream COM interface If @error Then Return SetError(3, 0, 0) Local Const $hBitmap = $aResult[2] Local $tVARIANT = DllStructCreate("word vt;word r1;word r2;word r3;ptr data; ptr") DllCall("oleaut32.dll", "long", "DispCallFunc", "ptr", $hStream, "dword", 8 + 8 * @AutoItX64, _ "dword", 4, "dword", 23, "dword", 0, "ptr", 0, "ptr", 0, "ptr", DllStructGetPtr($tVARIANT)) ;release memory from $hStream to avoid memory leak $tMem = 0 $tVARIANT = 0 If $hHBITMAP Then Local Const $hHBmp = _WinAPI_BitmapCreateDIBFromBitmap($hBitmap) _GDIPlus_BitmapDispose($hBitmap) Return $hHBmp EndIf Return $hBitmap EndFunc ;==>_GDIPlus_BMPFromMemory Func _WinAPI_BitmapCreateDIBFromBitmap($hBitmap) ;create 32-bit bitmap v5 (alpha channel supported) Local $tBIHDR, $aRet, $tData, $pBits, $hResult = 0 $aRet = DllCall($ghGDIPDll, 'uint', 'GdipGetImageDimension', 'ptr', $hBitmap, 'float*', 0, 'float*', 0) If (@error) Or ($aRet[0]) Then Return 0 $tData = _GDIPlus_BitmapLockBits($hBitmap, 0, 0, $aRet[2], $aRet[3], $GDIP_ILMREAD, $GDIP_PXF32ARGB) $pBits = DllStructGetData($tData, 'Scan0') If Not $pBits Then Return 0 $tBIHDR = DllStructCreate( 'dword bV5Size;long bV5Width;long bV5Height;word bV5Planes;word bV5BitCount;dword bV5Compression;' & _ ;http://msdn.microsoft.com/en-us/library/windows/desktop/dd183381(v=vs.85).aspx 'dword bV5SizeImage;long bV5XPelsPerMeter;long bV5YPelsPerMeter;dword bV5ClrUsed;dword bV5ClrImportant;' & _ 'dword bV5RedMask;dword bV5GreenMask;dword bV5BlueMask;dword bV5AlphaMask;dword bV5CSType;' & _ 'int bV5Endpoints[3];dword bV5GammaRed;dword bV5GammaGreen;dword bV5GammaBlue;dword bV5Intent;' & _ 'dword bV5ProfileData;dword bV5ProfileSize;dword bV5Reserved') DllStructSetData($tBIHDR, 'bV5Size', DllStructGetSize($tBIHDR)) DllStructSetData($tBIHDR, 'bV5Width', $aRet[2]) DllStructSetData($tBIHDR, 'bV5Height', $aRet[3]) DllStructSetData($tBIHDR, 'bV5Planes', 1) DllStructSetData($tBIHDR, 'bV5BitCount', 32) DllStructSetData($tBIHDR, 'bV5Compression', 0) ; $BI_BITFIELDS = 3, $BI_RGB = 0, $BI_RLE8 = 1, $BI_RLE4 = 2, $RGBA = 0x41424752 DllStructSetData($tBIHDR, 'bV5SizeImage', $aRet[3] * DllStructGetData($tData, 'Stride')) DllStructSetData($tBIHDR, 'bV5AlphaMask', 0xFF000000) DllStructSetData($tBIHDR, 'bV5RedMask', 0x00FF0000) DllStructSetData($tBIHDR, 'bV5GreenMask', 0x0000FF00) DllStructSetData($tBIHDR, 'bV5BlueMask', 0x000000FF) DllStructSetData($tBIHDR, 'bV5CSType', 2) ; LCS_WINDOWS_COLOR_SPACE = 2 DllStructSetData($tBIHDR, 'bV5Intent', 4) ; $LCS_GM_IMA $hResult = DllCall('gdi32.dll', 'ptr', 'CreateDIBSection', 'hwnd', 0, 'ptr', DllStructGetPtr($tBIHDR), 'uint', 0, 'ptr*', 0, 'ptr', 0, 'dword', 0) If (Not @error) And ($hResult[0]) Then DllCall('gdi32.dll', 'dword', 'SetBitmapBits', 'ptr', $hResult[0], 'dword', $aRet[2] * $aRet[3] * 4, 'ptr', DllStructGetData($tData, 'Scan0')) $hResult = $hResult[0] Else $hResult = 0 EndIf _GDIPlus_BitmapUnlockBits($hBitmap, $tData) $tData = 0 $tBIHDR = 0 Return $hResult EndFunc ;==>_WinAPI_BitmapCreateDIBFromBitmap ;Code below was generated by: 'File to Base64 String' Code Generator v1.11 Build 2012-10-13 Func _ChristianClub($bSaveBinary = False) Local $ChristianClub $ChristianClub &= 'R0lGODlhgwFzAYAAAAAAAP///yH5BAAAAAAALAAAAACDAXMBAAL/jI+py+0Po5y02ouz3rz7D4biSJbmiXrAyqbuC8fyTMcssKzGvev1DwwKh0TO7ehrtQJIX/EJjUqnoCWTibtmdTwnLksNi8dkW0/BO2OTByUYWY7L53TJMWHdtc9KLRjtVCc4SEiV9IXYk6jolYbGWBgpOUnD9YeQh8Vw+cBJ+QkaCtHUFdjm2DmKKsraCnpI+rVpmrpmReuaqyuWqXfqBpnjiZcWO7yLnEy0qLlmS3w862jKrGx9vfzst4Vb0a34yxiNTV6u0uR8Od65Hg73bR4vPwGX3m5xj3nl7Dvv/y8M0x10VfLt0bcKoMJ4bIDJShfC4MF+CyuS+4Nx20Bq/xJz4KtnMaS1WwK3PKNlUoPElCJbKnvIByaeTfoyGGTpMmeuXn5Ugdx34SZPnUQjIfqWj9ujoPSKOg1lqWdJO+BmegxID97TrWS4EdQ2ymq4U/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/KxoMlwy6VvFyqbGemRVn2nMEHyvf3unr5pjm3yznax1I0h36Yp+eKQkiBkufpYQz6e7mcPJQsrwt3j3HMRCqXyyXavK8cFmizFyNsVs8GqNfMyrvbawI6' $ChristianClub &= 'urOZWZsbaWR7wTpczrCrgWEqxRD7VtlCtPerTF0lyloLuLY8YDZym2ljzXUjxgqrZpmcQDgUtLXFWUW8Uc7sz4GHRA19JpMXs/6EyZp8xdkqSvB4gwUs0R4doX6ax66Eq8FMYDV8WtrcQf6r0AzsF/KrVUoby1XsxMPswe0iaEqGabvhNyY8riT8zHuswL4UtCj/Z4r3+sQKOc5XlnJJPWJ9d9C1c7slacJCfW3IwqP0fFhE/UfpPHU6RGNVLQ8wTcpus8mI7NV55Hxp/RLcHHq/+MvXzFhaHNdrzdY9vacvbawxHZJ6HYG5W0eMrKalbMci0nSml5oj575Rim4cTUUF1aVf+KNDZ9iHTaQCG05845HESollkc9YHNmr55+qmRFPLcVOE4WZHRqoPJBNQ7UpvdDdVlIyvc3gKMesi4XWpFpiPbnWuNsr69tG7bnALRyuHanxjL2PqNJ3jNzdbNUWeNJYVrKI3dQeM9IBna6rjN3MPdmPPWlajWgJ3cqvgNsyZtYL4ZZyHd0eFMnd697woYzBP9aV+Tsthnyz6U0mMznfyf3cJeVTAUTeWFk5ELHf0JeMoz3G2qsn620n6uRqyo2Jm42JFE4s8V3h8nNWAT62GM6XzurWgj2+EJ7E2FTgk6KD/WjiCS7eLg7jMe7iLS7j8mfcNX40kYvj7sraKb7jculEIv7jAAI0Ejvk1zhhRw7ddazkJa7aTQ7lUS7lU07lVW7lV47lWa7lW87lu1AAADs=' Local $bString = Binary(_Base64Decode($ChristianClub)) If $bSaveBinary Then Local $hFile = FileOpen(@ScriptDir & "\Europe.gif", 18) FileWrite($hFile, $bString) FileClose($hFile) EndIf Return $bString EndFunc ;==>_ChristianClub Func _Base64Decode($sB64String) Local $struct = DllStructCreate("int") Local $a_Call = DllCall("Crypt32.dll", "int", "CryptStringToBinary", "str", $sB64String, "int", 0, "int", 1, "ptr", 0, "ptr", DllStructGetPtr($struct, 1), "ptr", 0, "ptr", 0) If @error Or Not $a_Call[0] Then Return SetError(1, 0, "") Local $a = DllStructCreate("byte[" & DllStructGetData($struct, 1) & "]") $a_Call = DllCall("Crypt32.dll", "int", "CryptStringToBinary", "str", $sB64String, "int", 0, "int", 1, "ptr", DllStructGetPtr($a), "ptr", DllStructGetPtr($struct, 1), "ptr", 0, "ptr", 0) If @error Or Not $a_Call[0] Then Return SetError(2, 0, "") Return DllStructGetData($a, 1) EndFunc ;==>_Base64Decode I know this is not GDI but GDI+. Maybe it fulfill your needs, too. Limitation: recursion max. level of 3899 (x86). Br, UEZ
    1 point
  14. There is a great UDF doing this and more: I always use this one becaus $ES_NUMBER is much to less.
    1 point
  15. Roshith, Welcome to the AutoIt forum. Something I developed a while ago - it allows only digits, a decimal point and a leading minus. Set $iDecimal to the number of decimal places required: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> Global $iDecimal = 3 GUICreate("Input Filter", 300, 30, -1, -1) Global $inTest = GUICtrlCreateInput("", 5, 5, 290) GUIRegisterMsg($WM_COMMAND, "MY_WM_COMMAND") GUISetState(@SW_SHOW) While GUIGetMsg() <> $GUI_EVENT_CLOSE WEnd Func MY_WM_COMMAND($hWnd, $iMsg, $wParam, $lParam) Local $iIDFrom = BitAND($wParam, 0xFFFF);LoWord Local $iCode = BitShift($wParam, 16) ;HiWord If $iIDFrom = $inTest And $iCode = $EN_CHANGE Then $Read_Input = GUICtrlRead($inTest) If StringRegExp($Read_Input, '[^\d.-]|([{0-9,1}^\A-])[^\d.]') Then $Read_Input = StringRegExpReplace($Read_Input, '[^\d.-]|([{0-9,1}^\A-])[^\d.]', '\1') $Point1 = StringInStr($Read_Input, ".", 0) $Point2 = StringInStr($Read_Input, ".", 0, 2) If $Point2 <> 0 Then $Read_Input = StringLeft($Read_Input, $Point2 - 1) If $Point1 <> 0 Then $Read_Input = StringLeft($Read_Input, $Point1 + $iDecimal) GUICtrlSetData($inTest, $Read_Input) EndIf EndFunc;==>_WM_COMMANDPlease ask if you have any questions. M23
    1 point
  16. Jos

    Math problem no idea :(

    Why are you putting all number inside quotes (' ') ? This makes them a string by default. Only use the quotes for Strings, never for numbers. Also using For-Next loops is not the smartest way to test. Just use If--elseIf--EndIf or Select--Case-EndSelect logic for that. Jos
    1 point
×
×
  • Create New...