Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/14/2018 in all areas

  1. @qwert I was never in Switzerland but this shows the clock
    1 point
  2. You made some mistakes. Try this: #include <GDIplus.au3> #include <GUIConstantsEx.au3> #include <ButtonConstants.au3> _GDIPlus_Startup() Global $myImage = "https://www.autoitscript.com/forum/uploads/profile/photo-thumb-29844.png" Global $hBMPMem = _GDIPlus_BitmapCreateFromMemory(InetRead($myImage)) ;use GDI+ bitmap format!!! Global $hAttribute_Transparent_BMP = _GDIPlus_AttributeCreateTransparentBitmap($hBMPMem, 0.66666) Global $hGDIBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hAttribute_Transparent_BMP, 0xFFFFFFFF) Global $hGUI = GUICreate("", 300, 300, -1, -1) GUICtrlCreateTab(0,0,300,300) GUICtrlCreateTabItem("Test") Global $iPic = GUICtrlCreatePic("", 50, 50) _WinAPI_DeleteObject(GUICtrlSendMsg($iPic, 0x0172, 0, $hGDIBitmap)) ; $STM_SETIMAGE ;~ _WinAPI_DeleteObject(GUICtrlSendMsg($iPic, 0x0172, 0, $hBMPMem)) ; $STM_SETIMAGE GUICtrlCreateTabItem(""); end tabitem definition GUICtrlCreateTabItem("Test2") GUICtrlCreateTabItem(""); end tabitem definition GUISetState() Do Switch GUIGetMsg() Case $GUI_EVENT_CLOSE _GDIPlus_ImageDispose($hBMPMem) _GDIPlus_ImageDispose($hAttribute_Transparent_BMP) _WinAPI_DeleteObject($hGDIBitmap) _GDIPlus_Shutdown() GUIDelete() Exit EndSwitch Until False Func _GDIPlus_AttributeCreateTransparentBitmap($hImage, $fTransparency = 0.25) Local Const $hAttribute_Alpha = _GDIPlus_ImageAttributesCreate() ;~ $fTransparency = $fTransparency > 1 ? 1 : $fTransparency < 0 ? 0 : $fTransparency Local $tColorMatrix = _GDIPlus_ColorMatrixCreateTranslate(0, 0, 0, $fTransparency * -1) Local Const $pColorMatrix = DllStructGetPtr($tColorMatrix) _GDIPlus_ImageAttributesSetColorMatrix($hAttribute_Alpha, 0, True, $pColorMatrix) Local $aDim = _GDIPlus_ImageGetDimension($hImage) Local Const $aBitmap = _GDIPlus_BitmapCreateFromScan0($aDim[0], $aDim[1]) Local Const $hGfx = _GDIPlus_ImageGetGraphicsContext($aBitmap) _GDIPlus_GraphicsDrawImageRectRect($hGfx, $hImage, 0, 0, $aDim[0], $aDim[1], 0, 0, $aDim[0], $aDim[1], $hAttribute_Alpha) _GDIPlus_GraphicsDispose($hGfx) _GDIPlus_ImageAttributesDispose($hAttribute_Alpha) Return $aBitmap EndFunc
    1 point
  3. $x and $y are absolute Desktop's positions not relative to position of your control. When you want to have full control of mouse you may use direct mouse API functions, look at my MouseClickFast & MouseMoveFast:
    1 point
  4. I understand your first question not really. What do you mean with "set alpha channel"? You want to set a color to transparent? regarding your second question: #include <GDIplus.au3> #include <GUIConstantsEx.au3> #include <ButtonConstants.au3> _GDIPlus_Startup() Global $myImage = "https://p5.focus.de/img/fotos/crop3196039/3194875996-cv21_9-w630-h270-oc-q75-p5/Preise-Die-Jahresinflationsrate-in-den-USA-war-weniger-als-von-den-meisten-Experten-erwartet.jpg" Global $hBMPMem = _GDIPlus_BitmapCreateFromMemory(InetRead($myImage)) ;GDI+ bitmap Global $hGfx = _GDIPlus_ImageGetGraphicsContext($hBMPMem) _GDIPlus_GraphicsSetPixelOffsetMode($hGfx, 4) _GDIPlus_GraphicsSetSmoothingMode($hGfx, 4) _GDIPlus_GraphicsSetTextRenderingHint($hGfx, 4) Global $hBrush = _GDIPlus_BrushCreateSolid(0x80000000) _GDIPlus_GraphicsFillRect($hGfx, 100, 50, 300, 150, $hBrush) Global $hFormat = _GDIPlus_StringFormatCreate() Global $hFamily = _GDIPlus_FontFamilyCreate("Impact") Global $hFont = _GDIPlus_FontCreate($hFamily, 24) _GDIPlus_BrushSetSolidColor($hBrush, 0xF0FFFFFF) Global $tLayout = _GDIPlus_RectFCreate(150, 100, 300, 50) _GDIPlus_GraphicsDrawStringEx($hGfx, "Hello world", $hFont, $tLayout, $hFormat, $hBrush) Global $hBMPMemGDI = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBMPMem) _GDIPlus_FontDispose($hFont) _GDIPlus_FontFamilyDispose($hFamily) _GDIPlus_StringFormatDispose($hFormat) _GDIPlus_GraphicsDispose($hGfx) _GDIPlus_BrushDispose($hBrush) _GDIPlus_ImageDispose($hBMPMem) Global $hGUI = GUICreate("", 800, 800, -1, -1) GUICtrlCreateTab(0,0,800,700) GUICtrlCreateTabItem("Test") Global $iPic = GUICtrlCreatePic("", 50, 50, 630, 270) _WinAPI_DeleteObject(GUICtrlSendMsg($iPic, 0x0172, 0, $hBMPMemGDI)) ; $STM_SETIMAGE GUICtrlCreateTabItem(""); end tabitem definition GUICtrlCreateTabItem("Test2") GUICtrlCreateTabItem(""); end tabitem definition GUISetState() Do Switch GUIGetMsg() Case $GUI_EVENT_CLOSE _WinAPI_DeleteObject($hBMPMemGDI) _GDIPlus_Shutdown() GUIDelete() Exit EndSwitch Until False
    1 point
  5. If that's the actual code being used then something went wrong with your copy and paste i think. The character set for $aB128 doesn't match what was originally posted. Make sure you download the .au3 file posted when doing your tests. ±n8M:¶BF°n´S%Py]_½;UµPxEbx=:@P§[[n)w% bad49c8aa9505e47ee6176feb1ec1aa9 **Test Passed**
    1 point
×
×
  • Create New...