edumanilha Posted April 17, 2020 Share Posted April 17, 2020 (edited) Hi, everyone! I Put a slider into my GDI GUI, but I can't make it transparent...I tried some examples and everything...I tried with winapi redraw: _WinAPI_RedrawWindow($hGUI4, 0, 0, $RDW_UPDATENOW) ;Your Code must lie in it _WinAPI_RedrawWindow($hGUI4, 0, 0, $RDW_VALIDATE) and the setbitmap func: Func _SetBitmap($hGUI, $hImage, $iOpacity) ;Func _SetBitmap($hGUI, $hImage, $iOpacity, $n_width = 200, $n_height = 200) Local $hScrDC, $hMemDC, $hBitmap, $hOld, $pSize, $tSize, $pSource, $tSource, $pBlend, $tBlend $hScrDC = _WinAPI_GetDC(0) $hMemDC = _WinAPI_CreateCompatibleDC($hScrDC) $hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage) $hOld = _WinAPI_SelectObject($hMemDC, $hBitmap) $tSize = DllStructCreate($tagSIZE) $pSize = DllStructGetPtr($tSize) DllStructSetData($tSize, "X", _GDIPlus_ImageGetWidth($hImage)) DllStructSetData($tSize, "Y", _GDIPlus_ImageGetHeight($hImage)) ;DllStructSetData($tSize, "X", $n_width) ;DllStructSetData($tSize, "Y", $n_height) $tSource = DllStructCreate($tagPOINT) $pSource = DllStructGetPtr($tSource) $tBlend = DllStructCreate($tagBLENDFUNCTION) $pBlend = DllStructGetPtr($tBlend) DllStructSetData($tBlend, "Alpha", $iOpacity) DllStructSetData($tBlend, "Format", 1) _WinAPI_UpdateLayeredWindow($hGUI, $hScrDC, 0, $pSize, $hMemDC, $pSource, 0, $pBlend, $ULW_ALPHA) _WinAPI_ReleaseDC(0, $hScrDC) _WinAPI_SelectObject($hMemDC, $hOld) _WinAPI_DeleteObject($hBitmap) _WinAPI_DeleteDC($hMemDC) _GDIPlus_ImageDispose($hImage) EndFunc ;==>_SetBitmap And some dll example but from a very old topic... With winapi redraw, a black square appears on my image...And with setbitmap my script froze... WinSetTrans($hGUI5, "", GUICtrlRead($iSlider)) WinSetTrans($hGUI6, "", GUICtrlRead($iSlider)) _SetBitmap($SplashGUIlogo, $hSplashlogo,GUICtrlRead($iSlider)) Can anyone please give me a hand? Thanks in advance! Edited April 17, 2020 by edumanilha Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now