Jump to content

HurpaDerp

Members
  • Posts

    4
  • Joined

  • Last visited

HurpaDerp's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Nevermind, I managed to fix it. #NoTrayIcon #include <GDIPlus.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <WinAPI.au3> #include <WinAPIGdi.au3> #include <WinAPISys.au3> #include <WinAPITheme.au3> Local $hTheme = _WinAPI_OpenThemeData(_WinAPI_GetDesktopWindow(), "Button") Local $hDC = _WinAPI_CreateCompatibleDC(0) Local $tBITMAPINFO = __CreateBitmapInfo(50, 50) Local $pBits Local $hBmp = _WinAPI_CreateDIBSection(0, $tBITMAPINFO, $DIB_RGB_COLORS, $pBits) Local $hSel = _WinAPI_SelectObject($hDC, $hBmp) Local $tRect = _WinAPI_CreateRectEx(0, 0, 50, 50) _WinAPI_DrawThemeBackground($hTheme, 2, 5, $hDC, $tRect) _WinAPI_CloseThemeData($hTheme) _GDIPlus_Startup() Local $hBitmap = _GDIPlus_BitmapCreateFromScan0(50, 50, $GDIP_PXF32ARGB, 50*4, $pBits) _GDIPlus_ImageSaveToFile($hBitmap, @ScriptDir & "\Image.png") _GDIPlus_BitmapDispose($hBitmap) _GDIPlus_Shutdown() _WinAPI_SelectObject($hDC, $hSel) _WinAPI_DeleteObject($hBmp) _WinAPI_DeleteDC($hDC) Func __CreateBitmapInfo($iWidth, $iHeight) Local $tBITMAPINFO = DllStructCreate($tagBITMAPINFOHEADER & ";dword biRGBQuad") DllStructSetData($tBITMAPINFO, 'biWidth', $iWidth) DllStructSetData($tBITMAPINFO, 'biHeight', -$iHeight) DllStructSetData($tBITMAPINFO, 'biPlanes', 1) DllStructSetData($tBITMAPINFO, 'biBitCount', 32) DllStructSetData($tBITMAPINFO, 'biCompression', 0) DllStructSetData($tBITMAPINFO, 'biSizeImage', 0) DllStructSetData($tBITMAPINFO, 'biSize', DllStructGetSize($tBITMAPINFO) - 4) Return $tBITMAPINFO EndFunc ;==>__CreateBitmapInfo
  2. Heres a screenshot for clarity.
  3. Yes its definetly turning black. The radio button shouldn't have a black "border", you might have to zoom in a bit to see it. Its because its pre multiplying the alpha at some point, or it's drawing on a black background then combining onto the transparent one. I'm just not sure how to get it to draw directly onto the alpha bitmap.
  4. Im trying to create a script to extract control backgrounds for custom skinning, however the alpha background parts are turning black. Can anyone point me in the right direction please? #NoTrayIcon #include <GDIPlus.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <WinAPI.au3> #include <WinAPIGdi.au3> #include <WinAPITheme.au3> Local $hGUI = GUICreate("ThemeData") _GDIPlus_Startup() Local $hTheme = _WinAPI_OpenThemeData($hGUI, 'Button') Local $hBitmap = _GDIPlus_BitmapCreateFromScan0(50, 50, $GDIP_PXF32PARGB) Local $hGfx = _GDIPlus_ImageGetGraphicsContext($hBitmap) _GDIPlus_GraphicsClear($hGfx, 0x00) Local $hDC = _GDIPlus_GraphicsGetDC($hGfx) Local $tRect = _WinAPI_CreateRectEx(5, 5, 45, 45) _WinAPI_DrawThemeBackground($hTheme, 2, 5, $hDC, $tRect); Checked Radiobutton ; Cleanup _GDIPlus_GraphicsReleaseDC($hGfx, $hDC) _GDIPlus_GraphicsDispose($hGfx) _WinAPI_CloseThemeData($hTheme) _GDIPlus_ImageSaveToFile($hBitmap, @ScriptDir & "\Image.png") _GDIPlus_BitmapDispose($hBitmap) GUIDelete()
×
×
  • Create New...