Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/21/2014 in all areas

  1. mesale0077 asked me whether I could code some CSS loading animations from different web sites. These are the results using GDI+ (AutoIt v3.3.12.0+ required!): _GDIPlus_MonochromaticBlinker.au3 / _GDIPlus_RotatingBokeh.au3 _GDIPlus_SpinningCandy.au3 / _GDIPlus_SteamPunkLoading.au3 _GDIPlus_IncreasingBalls.au3 / _GDIPlus_PacmanProgressbar.au3 _GDIPlus_StripProgressbar.au3 / _GDIPlus_RingProgressbar.au3 _GDIPlus_LineProgressbar.au3 / _GDIPlus_SimpleLoadingAnim.au3 _GDIPlus_TextFillingWithWater.au3 / _GDIPlus_MultiColorLoader.au3 _GDIPlus_LoadingSpinner.au3 / _GDIPlus_SpinningAndPulsing.au3 _GDIPlus_TogglingSphere.au3 / _GDIPlus_CloudySpiral.au3 _GDIPlus_GlowingText.au3 (thanks to Eukalyptus) / _GDIPlus_HypnoticLoader.au3 _GDIPlus_RotatingRectangles.au3 / _GDIPlus_TRONSpinner.au3 _GDIPlus_RotatingBars.au3 / _GDIPlus_AnotherText.au3 (thanks to Eukalyptus) _GDIPlus_CogWheels.au3 (thanks to Eukalyptus) / _GDIPlus_DrawingText.au3 (thanks to Eukalyptus) _GDIPlus_GearsAnim.au3 / _GDIPlus_LEDAnim.au3 _GDIPlus_LoadingTextAnim.au3 / _GDIPlus_MovingRectangles.au3 _GDIPlus_SpinningAndGlowing.au3 (thanks to Eukalyptus) / _GDIPlus_YetAnotherLoadingAnim.au3 _GDIPlus_AnimatedTypeLoader.au3 / _GDIPlus_Carousel.au3 Each animation function has a built-in example how it can be used. AiO download: GDI+ Animated Wait Loading Screens.7z (previous downloads: 1757) Big thanks to Eukalyptus for providing several examples. Maybe useful for some of you Br, UEZ PS: I don't understand CSS - everything is made out of my mind, so it might be different from original CSS examples
    1 point
  2. Lupo73

    AutoComplete Input Text

    I found different solutions to do it and I finally decided to merge them in a single "optimal" code. During the typing it checks each new word (from the previous whitespace to the current pointer) and proposes to complete it with words included in a array. Predicted words are shown in a list under the input field and can be selected with mouse or with up/down/enter keys. These are the sources considered to create this code: '?do=embed' frameborder='0' data-embedContent>> '?do=embed' frameborder='0' data-embedContent>> '?do=embed' frameborder='0' data-embedContent>> '?do=embed' frameborder='0' data-embedContent>> '?do=embed' frameborder='0' data-embedContent>> '?do=embed' frameborder='0' data-embedContent>> And this is the code: #include <GUIConstantsEx.au3> #include <WinAPI.au3> #Include <GuiListBox.au3> #include <WindowsConstants.au3> Global $asKeyWords[21] = [20, "fight", "first", "fly", "third", "fire", "wall", "hi", "hello", "world", "window", _ "window 1", "window 2", "window 3", "window 4", "window 5", "window 6", "window 7", "window 8", "window 9", "window 10"] _Main() Func _Main() Local $hGUI, $hList, $hInput, $aSelected, $sChosen, $hUP, $hDOWN, $hENTER, $hESC Local $sCurrInput = "", $aCurrSelected[2] = [-1, -1], $iCurrIndex = -1, $hListGUI = -1 $hGUI = GUICreate("AutoComplete Input Text", 300, 100) GUICtrlCreateLabel('Start to type words like "window" or "fire" to test it:', 10, 10, 280, 20) $hInput = GUICtrlCreateInput("", 10, 40, 280, 20) GUISetState(@SW_SHOW, $hGUI) $hUP = GUICtrlCreateDummy() $hDOWN = GUICtrlCreateDummy() $hENTER = GUICtrlCreateDummy() $hESC = GUICtrlCreateDummy() Dim $AccelKeys[4][2] = [["{UP}", $hUP], ["{DOWN}", $hDOWN], ["{ENTER}", $hENTER], ["{ESC}", $hESC]] GUISetAccelerators($AccelKeys) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $hESC If $hListGUI <> -1 Then ; List is visible. GUIDelete($hListGUI) $hListGUI = -1 Else ExitLoop EndIf Case $hUP If $hListGUI <> -1 Then ; List is visible. $iCurrIndex -= 1 If $iCurrIndex < 0 Then $iCurrIndex = 0 EndIf _GUICtrlListBox_SetCurSel($hList, $iCurrIndex) EndIf Case $hDOWN If $hListGUI <> -1 Then ; List is visible. $iCurrIndex += 1 If $iCurrIndex > _GUICtrlListBox_GetCount($hList) - 1 Then $iCurrIndex = _GUICtrlListBox_GetCount($hList) - 1 EndIf _GUICtrlListBox_SetCurSel($hList, $iCurrIndex) EndIf Case $hENTER If $hListGUI <> -1 And $iCurrIndex <> -1 Then ; List is visible and a item is selected. $sChosen = _GUICtrlListBox_GetText($hList, $iCurrIndex) EndIf Case $hList $sChosen = GUICtrlRead($hList) EndSwitch Sleep(10) $aSelected = _GetSelectionPointers($hInput) If GUICtrlRead($hInput) <> $sCurrInput Or $aSelected[1] <> $aCurrSelected[1] Then ; Input content or pointer are changed. $sCurrInput = GUICtrlRead($hInput) $aCurrSelected = $aSelected ; Get pointers of the string to replace. $iCurrIndex = -1 If $hListGUI <> -1 Then ; List is visible. GUIDelete($hListGUI) $hListGUI = -1 EndIf $hList = _PopupSelector($hGUI, $hListGUI, _CheckInputText($sCurrInput, $aCurrSelected)) ; ByRef $hListGUI, $aCurrSelected. EndIf If $sChosen <> "" Then GUICtrlSendMsg($hInput, 0x00B1, $aCurrSelected[0], $aCurrSelected[1]) ; $EM_SETSEL. _InsertText($hInput, $sChosen) $sCurrInput = GUICtrlRead($hInput) GUIDelete($hListGUI) $hListGUI = -1 $sChosen = "" EndIf WEnd GUIDelete($hGUI) EndFunc ;==>_Main Func _CheckInputText($sCurrInput, ByRef $aSelected) Local $sPartialData = "" If (IsArray($aSelected)) And ($aSelected[0] <= $aSelected[1]) Then Local $aSplit = StringSplit(StringLeft($sCurrInput, $aSelected[0]), " ") $aSelected[0] -= StringLen($aSplit[$aSplit[0]]) If $aSplit[$aSplit[0]] <> "" Then For $A = 1 To $asKeyWords[0] If StringLeft($asKeyWords[$A], StringLen($aSplit[$aSplit[0]])) = $aSplit[$aSplit[0]] And $asKeyWords[$A] <> $aSplit[$aSplit[0]] Then $sPartialData &= $asKeyWords[$A] & "|" EndIf Next EndIf EndIf Return $sPartialData EndFunc ;==>_CheckInputText Func _PopupSelector($hMainGUI, ByRef $hListGUI, $sCurr_List) Local $hList = -1 If $sCurr_List = "" Then Return $hList EndIf $hListGUI = GUICreate("", 280, 160, 10, 62, $WS_POPUP, BitOR($WS_EX_TOOLWINDOW, $WS_EX_TOPMOST, $WS_EX_MDICHILD), $hMainGUI) $hList = GUICtrlCreateList("", 0, 0, 280, 150, BitOR(0x00100000, 0x00200000)) GUICtrlSetData($hList, $sCurr_List) GUISetControlsVisible($hListGUI) ; To Make Control Visible And Window Invisible. GUISetState(@SW_SHOWNOACTIVATE, $hListGUI) Return $hList EndFunc ;==>_PopupSelector Func _InsertText(ByRef $hEdit, $sString) #cs Description: Insert A Text In A Control. Returns: Nothing #ce Local $aSelected = _GetSelectionPointers($hEdit) GUICtrlSetData($hEdit, StringLeft(GUICtrlRead($hEdit), $aSelected[0]) & $sString & StringTrimLeft(GUICtrlRead($hEdit), $aSelected[1])) Local $iCursorPlace = StringLen(StringLeft(GUICtrlRead($hEdit), $aSelected[0]) & $sString) GUICtrlSendMsg($hEdit, 0x00B1, $iCursorPlace, $iCursorPlace) ; $EM_SETSEL. EndFunc ;==>_InsertText Func _GetSelectionPointers($hEdit) Local $aReturn[2] = [0, 0] Local $aSelected = GUICtrlRecvMsg($hEdit, 0x00B0) ; $EM_GETSEL. If IsArray($aSelected) Then $aReturn[0] = $aSelected[0] $aReturn[1] = $aSelected[1] EndIf Return $aReturn EndFunc ;==>_GetSelectionPointers Func GUISetControlsVisible($hWnd) ; By Melba23. Local $aControlGetPos = 0, $hCreateRect = 0, $hRectRgn = _WinAPI_CreateRectRgn(0, 0, 0, 0) Local $iLastControlID = _WinAPI_GetDlgCtrlID(GUICtrlGetHandle(-1)) For $i = 3 To $iLastControlID $aControlGetPos = ControlGetPos($hWnd, '', $i) If IsArray($aControlGetPos) = 0 Then ContinueLoop $hCreateRect = _WinAPI_CreateRectRgn($aControlGetPos[0], $aControlGetPos[1], $aControlGetPos[0] + $aControlGetPos[2], $aControlGetPos[1] + $aControlGetPos[3]) _WinAPI_CombineRgn($hRectRgn, $hCreateRect, $hRectRgn, 2) _WinAPI_DeleteObject($hCreateRect) Next _WinAPI_SetWindowRgn($hWnd, $hRectRgn, True) _WinAPI_DeleteObject($hRectRgn) EndFunc ;==>GUISetControlsVisible Any advice to improve the code is welcome.
    1 point
  3. Mas, Sooner or later you will want to know how to get back to your first gui... #include <GUIConstantsEx.au3> #include <ColorConstants.au3> #include <GuiConstants.au3> Global $GUI1, $GUI2 Opt("GUIOnEventMode", 1) ; Change to OnEvent mode GUI1() While 1 Sleep(100) WEnd Func GUI1() $GUI1 = GUICreate("title 1", 600, 500, -1, -1, $ws_popup + $ws_caption) GUISetOnEvent($GUI_EVENT_CLOSE, "_CloseButton") GUISetState() $Button = GUICtrlCreateButton("Next Step", 414, 446, 142, 32) GUICtrlSetOnEvent($Button, "GUI2") EndFunc ;==>GUI1 Func GUI2() GUISetState(@SW_HIDE, $GUI1) $GUI2 = GUICreate("title 2", 600, 500, -1, -1) GUISetOnEvent($GUI_EVENT_CLOSE, "_CloseButton") $Button2 = GUICtrlCreateButton("Next Step", 414, 446, 142, 32) GUICtrlSetOnEvent($Button2, "button2") GUISetState() EndFunc ;==>GUI2 Func _CloseButton() If @GUI_WinHandle = $GUI2 Then GUIDelete($GUI2) GUISetState(@SW_SHOW, $GUI1) Else Exit EndIf EndFunc ;==>_CloseButton Func Button2() MsgBox(0, '', 'gui2 working') EndFunc ;==>Button2 kylomas
    1 point
  4. The wiki has a very good tutorial that explains how to handle multiple GUIs.
    1 point
  5. I think if Excel is what you're comfortable with, it wouldn't hurt you any to start there. I just offered up SQL because it will increase your performance (as well as the end user experience) over using a bunch of (or, God Forbid, one giant) spreadsheets. I would go with what you're familiar with for the time being, as it sounds like time to Prod is an issue for you. But I would also invest the time looking through the help file at the different SQLite functions (start with _SQLite_Open). Each one has examples which can help you get an understanding of what you can do with them.
    1 point
  6. Yes, you can run queries for reports. You will also want to initiate a lock on each record to prevent more than one user trying to update the same record, which could cause corruption.
    1 point
  7. Why do you think I haven't already? Maybe I wrote different compiler for AutoIt scripts too. One that wouldn't freak out AV-s. Maybe Jon knows that but doesn't want me to share it with you? Maybe he thinks that would make him look incompetent? Maybe things are different below surface than on top? Things are sometimes very different below surface than on top. I'm not interested in fighting wars.
    1 point
  8. JLogan3o13

    autoit.exe

    From the link: Doesn't exactly inspire a lot of confidence....
    1 point
  9. Sounds like a help desk ticketing system, which is quite possible with AutoIt. I would, however, highly suggest taking a look at the SQLite functions in the help file to store your data. Excel will get unwieldy very quickly in this kind of scenario. For a gui, you could do something like this (very much off the top of my head): #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Local $msg GUICreate("Helpdesk Ticketing System", 1000, 650) ;======= $lblUrgency = GUICtrlCreateLabel("Urgency", 625, 15, 100, 20) $cUrgency = GUICtrlCreateCombo("", 600, 35, 100, 40) GUICtrlSetData($cUrgency, "Low|Medium|High") ;======= $lblImpact = GUICtrlCreateLabel("Impact", 745, 15, 100, 20) $cImpact = GUICtrlCreateCombo("", 720, 35, 100, 40) GUICtrlSetData($cImpact, "Individual|Group|Department|Enterprise") ;======= $lblPriority = GUICtrlCreateLabel("Priority", 875, 15, 100, 20) $cPriority = GUICtrlCreateCombo("", 840, 35, 120, 40) GUICtrlSetData($cPriority, "1 (Work Stoppage)|2 (High Priority)|3 (Medium)|4 (Low / Project)") ;======= $lblAssignment = GUICtrlCreateLabel("Assigned To:", 855, 80, 100, 30) $cAssignment = GUICtrlCreateCombo("", 800, 100, 180, 30) GUICtrlSetData($cAssignment, "Jim|Bob|Joe|Jeff") ;======= $lblIncident = GUICtrlCreateLabel("Incident Description", 10, 105, 150, 20) GUICtrlSetFont($lblIncident, 11, 600, Default, "Arial") $txtIncident = GUICtrlCreateInput("", 10, 130, 980, 400) ;======= $btnBegin = GUICtrlCreateButton("Begin Work", 10, 35, 80, 25) $btnResolve = GUICtrlCreateButton("Resolve", 100, 35, 80, 25) $btnUpdate = GUICtrlCreateButton("Update", 190, 35, 80, 25) ;======= $lblCategory = GUICtrlCreateLabel("Category", 50, 550, 100, 20) $cCategory = GUICtrlCreateCombo("", 10, 575, 150, 30) GUICtrlSetData($cCategory, "Software Request|Hardware Request|Incident|Data Change Request") ;======= $lblTicketTime = GUICtrlCreateLabel("Ticket Time", 200, 550, 100, 30) $ticketTime = GUICtrlCreateLabel("0:00", 210, 575, 100, 20) GUICtrlSetFont($ticketTime, 11, 600, Default, "Arial") ;======= $btnGo = GUICtrlCreateButton("Create Ticket", 900, 575, 90, 30) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd GUIDelete()
    1 point
  10. nbaser, This is how I would do it: #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> ; Create array to hold combo ControlIDs Global $a_workerscombo[1] = [0] $hGUI = GUICreate("Test", 500, 500) $cTab = GUICtrlCreateTab(10, 10, 480, 400) $cButton = GUICtrlCreateButton("New Tab", 10, 460, 80, 30) GUISetState() While 1 $iMsg = GUIGetMsg() Switch $iMsg Case $GUI_EVENT_CLOSE Exit Case $cButton NewMachine(" Name ", "cores") Case Else ; Loop through the array of combo ControlIDs For $i = 1 To $a_workerscombo[0] If $a_workerscombo[$i] = $iMsg Then ; When we find the correct one MsgBox($MB_SYSTEMMODAL, "Combo selected", GUICtrlRead($iMsg)) ; No point in looking any further ExitLoop EndIf Next EndSwitch WEnd Func NewMachine($machineName, $cores) ; Increase count $a_workerscombo[0] += 1 ; Resize array ReDim $a_workerscombo[$a_workerscombo[0] + 1] GUICtrlCreateTabItem("Machine:" & $machineName & $cores) ; Store combo ControlID in array $a_workerscombo[$a_workerscombo[0]] = GUICtrlCreateCombo("", 264, 72, 161, 25) ; Add different item to each combo so we can distinguish them later GUICtrlSetData(-1, "Combo " & $a_workerscombo[0] & "|0|1|2|3|4|5|6|7|8|9|10", "Combo " & $a_workerscombo[0]) GUICtrlCreateTabItem("") EndFunc ;==>NewMachine Please ask if anything is unclear. M23
    1 point
  11. The answer is in the link you pointed to #include <IE.au3> $oIE = _IE_Example("basic") $property = "id" $property2 = "innertext" $oDivs = _IETagNameGetCollection($oIE, "div") For $oDiv In $oDivs If Execute("$oDiv." & $property) == "line1" Then Msgbox(0,"", Execute("$oDiv." & $property2)) Next Edit : typos
    1 point
  12. trancexx

    Removal of PlugIn

    Don't cry over spilled and in this case breast milk. Plugin story is over. It was decision made by Jon so blah, it is what it is. What I fell sorry about is/are developers who got fucked up, nothing else. Plugin idea was wrong from day one, not because of some inferiorness (quite the opposite) but because AutoIt is not that kind of software. Its audience is wrong if nothing else.
    1 point
  13. There are different tools for that, some of which are written in AutoIt. My favorite is TYPELIB Viewer written by this girl drinking hot chocolate right now, ...uhm go figure. So, what you would have to do is run something like this: $oObj = ObjCreate("iTunes.Application") ; or whatever $sFile = ObjName($oObj, 4) ; file with interfaces definitions ConsoleWrite($sFile & @CRLF) MsgBox(4096, "", $sFile) Then find script called TLBViewer.au3 in examples forum, run it and load it with the file that you got (you can just drop the file onto the window or use "open" button). Then the script will extract all the available info about the object of your interest and display it. You can then copy text, or whatever, and save it to some file for further inspection.
    1 point
  14. BrewManNH

    TooTip focus

    Don't click on it?
    1 point
  15. Since 5 years member and only < 100 posts. Okeeeyyyyyy. You have to use the transparency code again to display an ellipse. ;coded by UEZ build 2013-05-02, idea from http://tympanus.net/codrops/2012/11/14/creative-css-loading-animations/ #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <Memory.au3> #include <GDIPlus.au3> #include <WindowsConstants.au3> ;AutoIt version 3.3.8.0 or higher needed! Please update! _GDIPlus_Startup() Global Const $STM_SETIMAGE = 0x0172, $iTransCol = 0x555555 Global $iW = 400, $iH = 210 Global Const $hGUI = GUICreate("Rotating Bokeh", $iW, $iH, -1, -1, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_TOPMOST)) Global Const $iPic = GUICtrlCreatePic("", 0, 0, $iW, $iH) GUICtrlSetState(-1, $GUI_DISABLE) _WinAPI_SetLayeredWindowAttributes($hGUI, $iTransCol, 0xFF) GUISetState() Global $hHBmp_BG, $hB, $iSleep = 20 GUIRegisterMsg($WM_TIMER, "PlayAnim") DllCall("user32.dll", "int", "SetTimer", "hwnd", $hGUI, "int", 0, "int", $iSleep, "int", 0) Global $iPerc Do Switch GUIGetMsg() Case $GUI_EVENT_CLOSE GUIRegisterMsg($WM_TIMER, "") _WinAPI_DeleteObject($hHBmp_BG) _GDIPlus_Shutdown() GUIDelete() Exit EndSwitch Until False Func PlayAnim() $hHBmp_BG = _GDIPlus_RotatingBokeh($iW, $iH, StringFormat("%05.2f %", $iPerc), 1, 0xFF000000 + $iTransCol) $hB = GUICtrlSendMsg($iPic, $STM_SETIMAGE, $IMAGE_BITMAP, $hHBmp_BG) If $hB Then _WinAPI_DeleteObject($hB) _WinAPI_DeleteObject($hHBmp_BG) $iPerc += 0.1 If $iPerc > 99.9 Then $iPerc = 0 EndFunc ;==>PlayAnim Func _GDIPlus_RotatingBokeh($iW, $iH, $sString = "Please wait...", $bHBitmap = True, $bBgTransCol = 0xFF010101, $iEllipseColor = 0xFF505050) Local Const $hBrushBall1 = _GDIPlus_BrushCreateSolid(0xE004AC6B) Local Const $hBrushBall2 = _GDIPlus_BrushCreateSolid(0xC0E0AB27) Local Const $hBrushBall3 = _GDIPlus_BrushCreateSolid(0xD081B702) Local Const $hBrushBall4 = _GDIPlus_BrushCreateSolid(0xB0E70339) Local Const $hBrushBg = _GDIPlus_BrushCreateSolid($iEllipseColor) Local Const $hPen = _GDIPlus_PenCreate(0xFF303030) DllCall($ghGDIPDll, "uint", "GdipSetPenLineJoin", "handle", $hPen, "int", 2) Local $hBitmap = DllCall($ghGDIPDll, "uint", "GdipCreateBitmapFromScan0", "int", $iW, "int", $iH, "int", 0, "int", $GDIP_PXF32ARGB, "ptr", 0, "int*", 0) $hBitmap = $hBitmap[6] Local Const $hCtxt = _GDIPlus_ImageGetGraphicsContext($hBitmap) _GDIPlus_GraphicsSetSmoothingMode($hCtxt, 2) _GDIPlus_GraphicsClear($hCtxt, $bBgTransCol) _GDIPlus_GraphicsFillEllipse($hCtxt, ($iW - $iH) / 2, 0, $iH, $iH, $hBrushBG) Local Const $fDeg = ACos(-1) / 180, $iRadius = 40, $iBallSize = $iRadius / 1.77, $iCircleSize = $iBallSize + 2 * $iRadius, $iBallSize2 = $iBallSize / 2, _ $iCircleSize2 = $iCircleSize / 2, $fFontSize = 11, $iW2 = -1 + $iW / 2, $iH2 = -1 + $iH / 2 Local Static $iAngle = 0 DllCall($ghGDIPDll, "int", "GdipDrawEllipse", "handle", $hCtxt, "handle", $hPen, "float", $iW2 - $iCircleSize2, "float", $iH2 - $iCircleSize2, "float", $iCircleSize, "float", $iCircleSize) DllCall($ghGDIPDll, "int", "GdipFillEllipse", "handle", $hCtxt, "handle", $hBrushBall1, "float", -$iBallSize2 + $iW2 + Cos(2.25 * $iAngle * $fDeg) * $iRadius, "float", -$iBallSize2 + $iH2 + Sin(2.25 * $iAngle * $fDeg) * $iRadius, "float", $iBallSize, "float", $iBallSize) DllCall($ghGDIPDll, "int", "GdipFillEllipse", "handle", $hCtxt, "handle", $hBrushBall2, "float", -$iBallSize2 + $iW2 + Cos(1.75 * $iAngle * $fDeg) * $iRadius, "float", -$iBallSize2 + $iH2 + Sin(1.75 * $iAngle * $fDeg) * $iRadius, "float", $iBallSize, "float", $iBallSize) DllCall($ghGDIPDll, "int", "GdipFillEllipse", "handle", $hCtxt, "handle", $hBrushBall3, "float", -$iBallSize2 + $iW2 + Cos(1.66 * $iAngle * $fDeg) * $iRadius, "float", -$iBallSize2 + $iH2 + Sin(1.66 * $iAngle * $fDeg) * $iRadius, "float", $iBallSize, "float", $iBallSize) DllCall($ghGDIPDll, "int", "GdipFillEllipse", "handle", $hCtxt, "handle", $hBrushBall4, "float", -$iBallSize2 + $iW2 + Cos(1.33 * $iAngle * $fDeg) * $iRadius, "float", -$iBallSize2 + $iH2 + Sin(1.33 * $iAngle * $fDeg) * $iRadius, "float", $iBallSize, "float", $iBallSize) $iAngle += 2.5 Local Const $hFormat = _GDIPlus_StringFormatCreate() Local Const $hFamily = _GDIPlus_FontFamilyCreate("Arial") Local Const $hFont = _GDIPlus_FontCreate($hFamily, $fFontSize, 2) Local Const $hBrushTxt = _GDIPlus_BrushCreateSolid(0xFFFFFFFF) Local Const $tLayout = _GDIPlus_RectFCreate(0, 0, 0, 0) Local Const $aInfo = _GDIPlus_GraphicsMeasureString($hCtxt, $sString, $hFont, $tLayout, $hFormat) DllStructSetData($tLayout, "X", ($iW - DllStructGetData($aInfo[0], "Width")) / 2) DllStructSetData($tLayout, "Y", $iH / 2 + $iRadius + $iBallSize) _GDIPlus_GraphicsDrawStringEx($hCtxt, $sString, $hFont, $tLayout, $hFormat, $hBrushTxt) _GDIPlus_FontDispose($hFont) _GDIPlus_FontFamilyDispose($hFamily) _GDIPlus_StringFormatDispose($hFormat) _GDIPlus_BrushDispose($hBrushTxt) _GDIPlus_GraphicsDispose($hCtxt) _GDIPlus_BrushDispose($hBrushBall1) _GDIPlus_BrushDispose($hBrushBall2) _GDIPlus_BrushDispose($hBrushBall3) _GDIPlus_BrushDispose($hBrushBall4) _GDIPlus_BrushDispose($hBrushBg) _GDIPlus_PenDispose($hPen) If $bHBitmap Then Local $hHBITMAP = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap) _GDIPlus_BitmapDispose($hBitmap) Return $hHBITMAP EndIf Return $hBitmap EndFunc ;==>_GDIPlus_RotatingBokeh Br, UEZ
    1 point
  16. Hi, the structure of the Bitmap File Format BMP is very easy. There is a 54 Bytes header which contains the description / properties of the picture, followed by (in your case a color-table) and the raw "Pixel"-Data. Your RAW Data contains SizeWidth + SizeHeight and the indices to the color-table. So if you only need to transform 8-BitPerPixel to SizeX-SizeY-RAW the following Script will do the job... $bmp = FileRead("alt2.bmp") ;load File $width_lowbyte = (StringMid($bmp, 0x13, 1)) ;extract width $width_highbyte = (StringMid($bmp, 0x14, 1)) ;you only need 2 Bytes of 4 for width in your case $height_lowbyte = (StringMid($bmp, 0x17, 1)) ;extract height $height_highbyte = (StringMid($bmp, 0x18, 1)) ;you only need 2 Bytes of 4 for height in your case $width = Asc($width_lowbyte) + 255 * Asc($width_highbyte); $height = Asc($height_lowbyte) + 255 * Asc($height_highbyte) $bmp_size = $width * $height ;math... $data = StringRight($bmp, $bmp_size) ;cut header and colorpalette $data_raw = "" ;data ist Bottom-up, so we have to transform... For $i = $bmp_size - $width + 1 To 1 Step -$width ;...lines from bottom to top $data_raw &= StringMid($data, $i, $width) Next FileDelete("alt2.raw") ;quick and dirty FileWrite("alt2.raw", $width_lowbyte & $width_highbyte & $height_lowbyte & $height_highbyte & $data_raw) ;put width and height and pixel together in a file If you have a valid color-table (palette) in an existing Bitmap-File, all you have to do is to edit the view bytes of width and height into the header and replace the "Pixel" (from the RAW)
    1 point
  17. $oSpan = _IEGetObjById($oIE, "ctl00_ContentBodyPlaceHolder_SearchResultsPanel_ctl00_DataGridCustomers_ctl03_CustomerId") _IEAction($oSpan, "click") If the above doesn't work, you'll need to get an object reference to the specific TD and then click on it in the same way. Dale
    1 point
×
×
  • Create New...