Jump to content

UEZ

MVPs
  • Posts

    7,296
  • Joined

  • Last visited

  • Days Won

    76

UEZ last won the day on April 7

UEZ had the most liked content!

About UEZ

  • Birthday 12/03/2007

Profile Information

  • Member Title
    Never say never
  • Location
    Germany
  • Interests
    Computer, watching movies, football (soccer), being lazy :-)

Recent Profile Visitors

8,592 profile views

UEZ's Achievements

  1. You can use _GDIPlus_ImageResize() instead. You have to do some math if you want to keep aspect ratio.
  2. Try this: Example1.au3 ;Coded by UEZ #AutoIt3Wrapper_UseX64=y #include <GUIConstantsEx.au3> #include "WebP.au3" ;~ Global $sFile Global $sFile = FileOpenDialog("Select an image", "", "Images (*.webp)") If @error Then Exit Global Const $STM_SETIMAGE = 0x0172 _GDIPlus_Startup() Global Const $hImage = WebP_BitmapCreateGDIp($sFile) ;load webp image as gdiplus Global Const $hImage_Scaled = _GDIPlus_ImageScale($hImage, 0.5, 0.5) ;shrink image to 50% Global Const $hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage_Scaled) ;convert gdiplus image to gdi image _GDIPlus_ImageDispose($hImage_Scaled) ;dispose gdiplus image _GDIPlus_ImageDispose($hImage) ;dispose gdiplus image ;get image dimension from gdi image Global $tDim = DllStructCreate($tagBITMAP) DllCall("gdi32.dll", "int", "GetObject", "int", $hBitmap, "int", DllStructGetSize($tDim), "ptr", DllStructGetPtr($tDim)) Global Const $iW = DllStructGetData($tDim, "bmWidth"), $iH = DllStructGetData($tDim, "bmHeight") ;display shrinked image in GUI Global Const $hGUI = GUICreate("WebP Image Viewer", $iW, $iH) GUISetBkColor(0xFFFFFF) Global Const $iPic = GUICtrlCreatePic("", 0, 0, $iW - 1, $iH - 1) _WinAPI_DeleteObject(GUICtrlSendMsg($iPic, $STM_SETIMAGE, $IMAGE_BITMAP, $hBitmap)) GUISetState() _WinAPI_DeleteObject($hBitmap) ;dispose gdi image _GDIPlus_Shutdown() Do Until GUIGetMsg() = $GUI_EVENT_CLOSE
  3. Maybe there are some dependencies missing (exports) for libpq.dll WS2_32.dll libintl-9.dll Secur32.dll WLDAP32.dll libssl-3-x64.dll libcrypto-3-x64.dll KERNEL32.dll SHELL32.dll ADVAPI32.dll VCRUNTIME140.dll api-ms-win-crt-heap-l1-1-0.dll api-ms-win-crt-convert-l1-1-0.dll api-ms-win-crt-string-l1-1-0.dll api-ms-win-crt-stdio-l1-1-0.dll api-ms-win-crt-runtime-l1-1-0.dll api-ms-win-crt-environment-l1-1-0.dll api-ms-win-crt-time-l1-1-0.dll api-ms-win-crt-utility-l1-1-0.dll api-ms-win-crt-math-l1-1-0.dll api-ms-win-crt-locale-l1-1-0.dll api-ms-win-crt-filesystem-l1-1-0.dll because DllOpen(@ScriptDir & "\libpq.dll") returns -1 which is not ok.
  4. Try Local $Conn = DllCall(@ScriptDir & "\libpq.dll","int","PQlibVersion") or if cdecl calling method Local $Conn = DllCall(@ScriptDir & "\libpq.dll","int:cdecl","PQlibVersion")
  5. I misread the question but you can cut the string from CRLF #include <GUIConstantsEx.au3> $sTitle = "AutoIt v3" & @CRLF & "A BASIC-like scripting language" & @CRLF & "Blah" $sNew = StringRegExp($sTitle, "(.+)\r\n", 3) $hGUI = GUICreate(IsArray($sNew) ? $sNew[0] : $sTitle, 400, 100) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd GUIDelete($hGUI)
  6. Works on my Win10 22h2 Notebook properly.
  7. This works for me: ;Coded by UEZ build 2024-06-29 #include <WinAPIConv.au3> #AutoIt3Wrapper_UseX64=n Global Const $XM_RESOURCE = 0, $XM_MEMORY = 1, $XM_FILE = 2, $XM_NOLOOP = 8, $XM_SUSPENDED = 16, $uFMOD_MIN_VOL = 0, $uFMOD_MAX_VOL = 25, $uFMOD_DEFAULT_VOL = 25 Global $g_iDLLPath = DllOpen(@ScriptDir & "\ufmod.dll") Func uFMOD_PlaySongFile($sFilename, $param = 0, $fdwSong = $XM_FILE) Local Const $aReturn = DllCall($g_iDLLPath, "ptr", "uFMOD_PlaySong", "str", $sFilename, "ulong", $param, "ulong", $fdwSong) If @error Or Not IsArray($aReturn) Then Return SetError(1, 0, 0) If Not $aReturn[0] Then Return SetError(2, 0, 0) Return $aReturn[0] EndFunc Func uFMOD_PlaySongMem($pMem, $iSize, $fdwSong = $XM_MEMORY) Local Const $aReturn = DllCall($g_iDLLPath, "ptr", "uFMOD_PlaySong", "ptr", $pMem, "ulong", $iSize, "ulong", $fdwSong) If @error Or Not IsArray($aReturn) Then Return SetError(1, 0, 0) If Not $aReturn[0] Then Return SetError(2, 0, 0) Return $aReturn[0] EndFunc Func uFMOD_StopSong() DllCall($g_iDLLPath, "ptr", "uFMOD_PlaySong", "str", "", "long", 0, "long", 0) Return 1 EndFunc Func uFMOD_PauseSong() DllCall($g_iDLLPath, "none", "uFMOD_Pause") Return 1 EndFunc Func uFMOD_ResumeSong() DllCall($g_iDLLPath, "none", "uFMOD_Resume") Return 1 EndFunc Func uFMOD_SetVolume($iVol) DllCall($g_iDLLPath, "none", "uFMOD_SetVolume", "long", $iVol) Return 1 EndFunc Func uFMOD_GetStats() Local Const $aReturn = DllCall($g_iDLLPath, "int", "uFMOD_GetStats") If @error Or Not IsArray($aReturn) Then Return SetError(1, 0, 0) If Not $aReturn[0] Then Return SetError(2, 0, 0) Local $aRMS[] = [_WinAPI_HiWord($aReturn[0]), _WinAPI_LoWord($aReturn[0])] ;L / R channel Return $aRMS EndFunc Func uFMOD_GetRowOrder() Local Const $aReturn = DllCall($g_iDLLPath, "int", "uFMOD_GetRowOrder") If @error Or Not IsArray($aReturn) Then Return SetError(1, 0, 0) If Not $aReturn[0] Then Return SetError(2, 0, 0) Return $aReturn[0] EndFunc Func uFMOD_GetTime() Local Const $aReturn = DllCall($g_iDLLPath, "long", "uFMOD_GetTime") If @error Or Not IsArray($aReturn) Then Return SetError(1, 0, 0) If Not $aReturn[0] Then Return SetError(2, 0, 0) Return $aReturn[0] EndFunc Func uFMOD_GetTitle() Local Const $aReturn = DllCall($g_iDLLPath, "str", "uFMOD_GetTitle") If @error Or Not IsArray($aReturn) Then Return SetError(1, 0, 0) If Not $aReturn[0] Then Return SetError(2, 0, 0) Return $aReturn[0] EndFunc Func uFMOD_Jump2Pattern($iPattern) DllCall($g_iDLLPath, "none", "uFMOD_Jump2Pattern", "long", $iPattern) Return 1 EndFunc uFMOD_PlaySongFile(<YOUR XM FILE>) ;<<<<<<<<<<<<<<<<<<< change it While Sleep(10) If uFMOD_GetTime() > 10000 Then ExitLoop WEnd uFMOD_StopSong() DllClose($g_iDLLPath) Important is to load the DLL via DllOpen() otherwise it will crash.
  8. Try $return = DllCall($hDLL, "int", "uFMOD_PlaySong", "str", $xm, "uint", 0, "uint", 2) "STR*" is a string pointer which is wrong here. Before exiting the script I would suggest to stop the player by DllCall($hDLL, "int", "uFMOD_PlaySong", "str", 0, "uint", 0, "uint", 0)
  9. Looks nice. I modified my example above a little bit: ;Coded by UEZ build 2024-06-27 #include <GDIPlus.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Global Const $STM_SETIMAGE = 0x0172 _GDIPlus_Startup() ;initialize GDI+ Global Const $iWidth = 600, $iHeight = 300, $iBgColor = 0x303030 ;$iBgColor format RRGGBB Global $hGUI = GUICreate("GDI+ Test", $iWidth, $iHeight) ;create a test GUI GUISetBkColor($iBgColor, $hGUI) ;set GUI background color GUISetState(@SW_SHOW) Global $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGUI) ;create a graphics object from a window handle _GDIPlus_GraphicsSetSmoothingMode($hGraphics, $GDIP_SMOOTHINGMODE_HIGHQUALITY) ;sets the graphics object rendering quality (antialiasing) Global $iW = $iWidth * 0.8, $iH = 30 Global $aImage_PB1 = _GDIPlus_BitmapCreateProgressbar($iW, $iH, 0xFFFFFF00, 0, 0, 1) Global $aImage_PB2 = _GDIPlus_BitmapCreateProgressbar($iW, $iH, 0xFF400000, 0xFFFF4040, 0, 2) Global $aImage_PB3 = _GDIPlus_BitmapCreateProgressbar($iW, $iH, 0xFF004000, 0xFF40FF40, 0xF0E0FFE0, 3, $iW / 2, $iH / 2) _GDIPlus_GraphicsDrawImageRect($hGraphics, $aImage_PB1[0], ($iWidth - $iW) / 2, $iHeight * 0.10, $iW, $iH) _GDIPlus_GraphicsDrawImageRectRect($hGraphics, $aImage_PB1[1], 0, 0, $iW / 2, $iH, ($iWidth - $iW) / 2, $iHeight * 0.10, $iW / 2, $iH) _GDIPlus_GraphicsDrawImageRect($hGraphics, $aImage_PB2[0], ($iWidth - $iW) / 2, $iHeight * 0.40, $iW, $iH) _GDIPlus_GraphicsDrawImageRectRect($hGraphics, $aImage_PB2[1], 0, 0, $iW / 2, $iH, ($iWidth - $iW) / 2, $iHeight * 0.40, $iW / 2, $iH) _GDIPlus_GraphicsDrawImageRect($hGraphics, $aImage_PB3[0], ($iWidth - $iW) / 2, $iHeight * 0.70, $iW, $iH) _GDIPlus_GraphicsDrawImageRectRect($hGraphics, $aImage_PB3[1], 0, 0, $iW / 2, $iH, ($iWidth - $iW) / 2, $iHeight * 0.70, $iW / 2, $iH) Global $iSleep = 10, $fProgress = 0, $aPos = WinGetPos($hGUI) Global $hGUI_PB = GUICreate("Progressbar Example", $iW + 10, $iH + 10, -1, $aPos[1] + $aPos[3] - $iH) Global $iPB = GUICtrlCreatePic("", 5, 5, $iW, $iH), $hPB = GUICtrlGetHandle($iPB) GUISetState(@SW_SHOW, $hGUI_PB) GUIRegisterMsg($WM_TIMER, "SetProgressbar") DllCall("user32.dll", "int", "SetTimer", "hwnd", $hGUI, "int", 0, "int", $iSleep, "int", 0) Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIRegisterMsg($WM_TIMER, "") ;cleanup GDI+ resources _GDIPlus_ImageDispose($aImage_PB1[0]) _GDIPlus_ImageDispose($aImage_PB1[1]) _GDIPlus_ImageDispose($aImage_PB2[0]) _GDIPlus_ImageDispose($aImage_PB2[1]) _GDIPlus_ImageDispose($aImage_PB3[0]) _GDIPlus_ImageDispose($aImage_PB3[1]) _WinAPI_DeleteObject($aImage_PB1[2]) _WinAPI_DeleteObject($aImage_PB1[3]) _WinAPI_DeleteObject($aImage_PB2[2]) _WinAPI_DeleteObject($aImage_PB2[3]) _WinAPI_DeleteObject($aImage_PB3[2]) _WinAPI_DeleteObject($aImage_PB3[3]) _GDIPlus_GraphicsDispose($hGraphics) _GDIPlus_Shutdown() GUIDelete($hGUI) Func SetProgressbar() $fProgress = Mod($fProgress + 0.1, 100) Local $fP = Max(Min(100, $fProgress), 0) Local $fWidth = $fP / 100 * $iW Static $cx = 0 Local $aBitmap = _GDIPlus_BitmapCreateProgressbar($iW, $iH, 0xFF004000, 0xFF40FF40, 0xF0E0FFE0, 3, Abs(Sin($cx / 100) * 2 * $iW) - $iW, $iH / 2) $cx += 1 Local Const $hBmp = _GDIPlus_BitmapCloneArea($aImage_PB3[0], 0, 0, $iW, $iH, $GDIP_PXF32ARGB), _ $hGfx = _GDIPlus_ImageGetGraphicsContext($hBmp) _GDIPlus_GraphicsDrawImageRectRect($hGfx, $aBitmap[1], 0, 0, $fWidth, $iH, 0, 0, $fWidth, $iH) Local Const $hBrush = _GDIPlus_BrushCreateSolid(0xFF000000) Local Const $hFormat = _GDIPlus_StringFormatCreate() Local Const $hFamily = _GDIPlus_FontFamilyCreate("Arial") Local Const $hFont = _GDIPlus_FontCreate($hFamily, $iH / 3, 0) Local Const $tLayout = _GDIPlus_RectFCreate(0, 0, $iW, $iH) _GDIPlus_StringFormatSetAlign($hFormat, 1) _GDIPlus_StringFormatSetLineAlign($hFormat, 1) _GDIPlus_GraphicsDrawStringEx($hGfx, Int($fP) & "%", $hFont, $tLayout, $hFormat, $hBrush) _GDIPlus_BrushDispose($hBrush) _GDIPlus_StringFormatDispose($hFormat) _GDIPlus_FontFamilyDispose($hFamily) _GDIPlus_FontDispose($hFont) Local Const $hBmp_GDI = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBmp) Local Const $hB = GUICtrlSendMsg($iPB, $STM_SETIMAGE, $IMAGE_BITMAP, $hBmp_GDI) If $hB Then _WinAPI_DeleteObject($hB) _GDIPlus_ImageDispose($hBmp) _GDIPlus_GraphicsDispose($hGfx) _WinAPI_DeleteObject($hBmp_GDI) _GDIPlus_ImageDispose($aBitmap[0]) _GDIPlus_ImageDispose($aBitmap[1]) _WinAPI_DeleteObject($aBitmap[2]) _WinAPI_DeleteObject($aBitmap[3]) EndFunc Func Max($a, $b) Return $a > $b ? $a : $b EndFunc Func Min($a, $b) Return $a < $b ? $a : $b EndFunc Func _GDIPlus_BitmapCreateProgressbar($iW, $iH, $iStartColor = 0xFF004000, $iEndColor = 0xFF40FF40, $iCenterColor = 0xF0E0FFE0, $iMode = 3, $fXC = 0, $fCY = 0, $iBlur = 5, $iWrapMode = 3) Local Const $hBitmap = _GDIPlus_BitmapCreateFromScan0($iW, $iH) Local Const $hCtxt = _GDIPlus_ImageGetGraphicsContext($hBitmap) _GDIPlus_GraphicsSetSmoothingMode($hCtxt, $GDIP_SMOOTHINGMODE_HIGHQUALITY) Local $hBrush, $hPath = _GDIPlus_PathCreate() Switch $iMode Case 1 $hBrush = _GDIPlus_BrushCreateSolid($iStartColor) Case 2 Local $tRECTF = _GDIPlus_RectFCreate(0, 0, $iW, $iH / 2) $hBrush = _GDIPlus_LineBrushCreateFromRectWithAngle($tRECTF, $iStartColor, $iEndColor, 90, False, $iWrapMode) _GDIPlus_LineBrushSetGammaCorrection($hBrush, True) Case 3 $hBrush = _GDIPlus_BrushCreateSolid($iStartColor) _GDIPlus_GraphicsFillRect($hCtxt, 0, 0, $iW, $iH, $hBrush) _GDIPlus_BrushDispose($hBrush) _GDIPlus_PathAddRectangle($hPath, 0, 0, $iW, $iH) $hBrush = _GDIPlus_PathBrushCreateFromPath($hPath) Local $aColors[3] = [2, $iStartColor, $iEndColor] _GDIPlus_PathBrushSetSurroundColorsWithCount($hBrush, $aColors) _GDIPlus_PathBrushSetCenterColor($hBrush, $iCenterColor) _GDIPlus_PathBrushSetCenterPoint($hBrush, $fXC, $fCY) _GDIPlus_PathBrushSetWrapMode($hBrush, $iWrapMode) _GDIPlus_PathBrushSetGammaCorrection($hBrush, True) EndSwitch _GDIPlus_GraphicsFillRect($hCtxt, 0, 0, $iW, $iH, $hBrush) _GDIPlus_BrushDispose($hBrush) Local $iColor Switch $iMode Case 1 $iColor = ColorChange($iStartColor, 0.4) Case 2 $iColor = 0x20FFFFFF Case 3 $iColor = 0x60FFFFFF EndSwitch $hBrush = _GDIPlus_BrushCreateSolid($iColor) _GDIPlus_GraphicsFillRect($hCtxt, 0, $iH * 0.85, $iW, $iH, $hBrush) Switch $iMode Case 1 $iColor = ColorChange($iStartColor, 0.5) Case 2 $iColor = ColorChange($iStartColor) Case 3 $iColor = ColorChange($iStartColor) EndSwitch _GDIPlus_BrushSetSolidColor($hBrush, $iColor) _GDIPlus_GraphicsFillRect($hCtxt, 0, 0, $iW * 0.03, $iH, $hBrush) _GDIPlus_GraphicsFillRect($hCtxt, $iW * 0.97, 0, $iW, $iH, $hBrush) Switch $iMode Case 1 $iColor = ColorChange($iStartColor, 0.1) Case 2 $iColor = 0x40FFFFFF Case 3 $iColor = 0x50FFFFFF EndSwitch _GDIPlus_BrushSetSolidColor($hBrush, $iColor) _GDIPlus_GraphicsFillRect($hCtxt, 0, 0, $iW, $iH * 0.225, $hBrush) Local $hEffect = _GDIPlus_EffectCreateBlur($iBlur) _GDIPlus_BitmapApplyEffect($hBitmap, $hEffect) _GDIPlus_EffectDispose($hEffect) Local $hBitmap_Bg = _GDIPlus_BitmapCloneArea($hBitmap, 0, 0, $iW, $iH, $GDIP_PXF32ARGB) Local $tColorMatrix = _GDIPlus_ColorMatrixCreateGrayScale() $hEffect = _GDIPlus_EffectCreateColorMatrix($tColorMatrix) _GDIPlus_BitmapApplyEffect($hBitmap_Bg, $hEffect) _GDIPlus_EffectDispose($hEffect) _GDIPlus_BrushDispose($hBrush) _GDIPlus_GraphicsDispose($hCtxt) _GDIPlus_PathDispose($hPath) Local $aBitmaps[] = [$hBitmap_Bg, $hBitmap, _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap_Bg), _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap)] Return $aBitmaps EndFunc Func ColorChange($iColor, $fFactor = 0.99) Local $iR = BitShift(BitAND($iColor, 0xFF0000), 16), $iG = BitShift(BitAND($iColor, 0xFF00), 8), $iB = BitAND($iColor, 0xFF) Return BitOR(BitAND($iColor, 0x20000000), BitShift($iR * $fFactor, -16), BitShift($iG * $fFactor, -8), $iB * $fFactor) EndFunc
  10. Here something you can play with: ;Coded by UEZ build 2024-06-25 #include <GDIPlus.au3> #include <GUIConstantsEx.au3> _GDIPlus_Startup() ;initialize GDI+ Global Const $iWidth = 600, $iHeight = 300, $iBgColor = 0x303030 ;$iBgColor format RRGGBB Global $hGUI = GUICreate("GDI+ Test", $iWidth, $iHeight) ;create a test GUI GUISetBkColor($iBgColor, $hGUI) ;set GUI background color GUISetState(@SW_SHOW) Global $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGUI) ;create a graphics object from a window handle _GDIPlus_GraphicsSetSmoothingMode($hGraphics, $GDIP_SMOOTHINGMODE_HIGHQUALITY) ;sets the graphics object rendering quality (antialiasing) Global $iW = $iWidth * 0.8, $iH = 30 Global $hImage_PB1 = _GDIPlus_BitmapCreateProgressbar($iW, $iH, 0xFFFFFF00, 0, 0, 1) Global $hImage_PB2 = _GDIPlus_BitmapCreateProgressbar($iW, $iH, 0xFF400000, 0xFFFF4040, 0, 2) Global $hImage_PB3 = _GDIPlus_BitmapCreateProgressbar($iW, $iH) _GDIPlus_GraphicsDrawImageRect($hGraphics, $hImage_PB1, ($iWidth - $iW) / 2, $iHeight * 0.10, $iW, $iH) _GDIPlus_GraphicsDrawImageRect($hGraphics, $hImage_PB2, ($iWidth - $iW) / 2, $iHeight * 0.40, $iW, $iH) _GDIPlus_GraphicsDrawImageRect($hGraphics, $hImage_PB3, ($iWidth - $iW) / 2, $iHeight * 0.70, $iW, $iH) Do Until GUIGetMsg() = $GUI_EVENT_CLOSE ;cleanup GDI+ resources _GDIPlus_ImageDispose($hImage_PB1) _GDIPlus_ImageDispose($hImage_PB2) _GDIPlus_ImageDispose($hImage_PB3) _GDIPlus_GraphicsDispose($hGraphics) _GDIPlus_Shutdown() GUIDelete($hGUI) Func _GDIPlus_BitmapCreateProgressbar($iW, $iH, $iStartColor = 0xFF004000, $iEndColor = 0xFF40FF40, $iCenterColor = 0xF0E0FFE0, $iMode = 3, $iBlur = 5, $iWrapMode = 3) Local Const $hBitmap = _GDIPlus_BitmapCreateFromScan0($iW, $iH) Local Const $hCtxt = _GDIPlus_ImageGetGraphicsContext($hBitmap) _GDIPlus_GraphicsSetSmoothingMode($hCtxt, $GDIP_SMOOTHINGMODE_HIGHQUALITY) Local $hBrush, $hPath = _GDIPlus_PathCreate() Switch $iMode Case 1 $hBrush = _GDIPlus_BrushCreateSolid($iStartColor) Case 2 Local $tRECTF = _GDIPlus_RectFCreate(0, 0, $iW, $iH / 2) $hBrush = _GDIPlus_LineBrushCreateFromRectWithAngle($tRECTF, $iStartColor, $iEndColor, 90, False, $iWrapMode) _GDIPlus_LineBrushSetGammaCorrection($hBrush, True) Case 3 $hBrush = _GDIPlus_BrushCreateSolid($iStartColor) _GDIPlus_GraphicsFillRect($hCtxt, 0, 0, $iW, $iH, $hBrush) _GDIPlus_BrushDispose($hBrush) _GDIPlus_PathAddRectangle($hPath, 0, 0, $iW, $iH) $hBrush = _GDIPlus_PathBrushCreateFromPath($hPath) Local $aColors[3] = [2, $iStartColor, $iEndColor] _GDIPlus_PathBrushSetSurroundColorsWithCount($hBrush, $aColors) _GDIPlus_PathBrushSetCenterColor($hBrush, $iCenterColor) _GDIPlus_PathBrushSetCenterPoint($hBrush, $iW / 2, $iH / 2) _GDIPlus_PathBrushSetWrapMode($hBrush, $iWrapMode) _GDIPlus_PathBrushSetGammaCorrection($hBrush, True) EndSwitch _GDIPlus_GraphicsFillRect($hCtxt, 0, 0, $iW, $iH, $hBrush) _GDIPlus_BrushDispose($hBrush) Local $iColor Switch $iMode Case 1 $iColor = ColorChange($iStartColor, 0.4) Case 2 $iColor = 0x20FFFFFF Case 3 $iColor = 0x60FFFFFF EndSwitch $hBrush = _GDIPlus_BrushCreateSolid($iColor) _GDIPlus_GraphicsFillRect($hCtxt, 0, $iH * 0.85, $iW, $iH, $hBrush) Switch $iMode Case 1 $iColor = ColorChange($iStartColor, 0.5) Case 2 $iColor = ColorChange($iStartColor) Case 3 $iColor = ColorChange($iStartColor) EndSwitch _GDIPlus_BrushSetSolidColor($hBrush, $iColor) _GDIPlus_GraphicsFillRect($hCtxt, 0, 0, $iW * 0.03, $iH, $hBrush) _GDIPlus_GraphicsFillRect($hCtxt, $iW * 0.97, 0, $iW, $iH, $hBrush) Switch $iMode Case 1 $iColor = ColorChange($iStartColor, 0.1) Case 2 $iColor = 0x40FFFFFF Case 3 $iColor = 0x50FFFFFF EndSwitch _GDIPlus_BrushSetSolidColor($hBrush, $iColor) _GDIPlus_GraphicsFillRect($hCtxt, 0, 0, $iW, $iH * 0.225, $hBrush) Local $hEffect = _GDIPlus_EffectCreateBlur($iBlur) _GDIPlus_BitmapApplyEffect($hBitmap, $hEffect) _GDIPlus_EffectDispose($hEffect) _GDIPlus_BrushDispose($hBrush) _GDIPlus_GraphicsDispose($hCtxt) _GDIPlus_PathDispose($hPath) Return $hBitmap EndFunc Func ColorChange($iColor, $fFactor = 0.99) Local $iR = BitShift(BitAND($iColor, 0xFF0000), 16), $iG = BitShift(BitAND($iColor, 0xFF00), 8), $iB = BitAND($iColor, 0xFF) Return BitOR(BitAND($iColor, 0x20000000), BitShift($iR * $fFactor, -16), BitShift($iG * $fFactor, -8), $iB * $fFactor) EndFunc
  11. I cannot image what you mean. Do you have an example how it should look like? Here some progress bars:
  12. Good work but it flickers on refresh. I would suggest to use double buffering to avoid flashing.
  13. The problem is that the image is semi-transparent and thus it looks good on white background. If you change the bg to black the result is the same as in your code. I don't have an idee yet how to display it with white bg but in a transparent GUI. Edit: If your bg is light then you can use: While Sleep(10) _GDIPlus_GraphicsClear($hBackbuffer, 0) ; Clear with opaque black color _GDIPlus_MatrixRotate($hMatrix, $iAngle, "False") _GDIPlus_GraphicsSetTransform($hBackbuffer, $hMatrix) _GDIPlus_GraphicsDrawImageRect($hBackbuffer, $hBG_Bitmap, -$rot_mid_x / 2, -$rot_mid_y / 2, $width / 2, $height / 2) $GDIBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap, 0xFFFFFFFF) _WinAPI_SelectObject($dc, $GDIBitmap) _WinAPI_UpdateLayeredWindow($hWnd, $ScreenDc, 0, $pSize, $dc, $pSource, 0xFFFFFFFF, $pBlend, 1) _WinAPI_DeleteObject($GDIBitmap) WEnd which will add white as a bg color.
  14. I changed it to 2 decimals, too. Now more colors will be used.
×
×
  • Create New...