Jump to content

Transparency on Bitmap


rliiack
 Share

Recommended Posts

#Include <GUIConstantsEx.au3>
#Include <WindowsConstants.au3>

$hForm = GUICreate('', 600, 400, -1, -1, $WS_POPUP)
$Pic = GUICtrlCreatePic('', -400, -250, 1024, 768, -1, $GUI_WS_EX_PARENTDRAG)
GUISetState()

InetGet('http://dota.ru/3d/big/p324_42.jpg', @TempDir & '\~test.jpg')
GUICtrlSetImage($Pic, @TempDir & '\~test.jpg')
FileDelete(@TempDir & '\~test.jpg')

WinSetTrans($hForm, '', 200)

Do
Until GUIGetMsg() = -3

Link to comment
Share on other sites

No, there is no simple way. Here's one way.

#Include <GUIConstantsEx.au3>
#Include <WindowsConstants.au3>

GUIRegisterMsg($WM_MOVE, 'WM_MOVE')

$Form1 = GUICreate('', 600, 400, 200, 200, $WS_POPUP)
$Pic1 = GUICtrlCreatePic('', -400, -250, 1024, 768, -1, $GUI_WS_EX_PARENTDRAG)
$Form2 = GUICreate('', 300, 400, 500, 200, $WS_POPUP)
$Pic2 = GUICtrlCreatePic('', -700, -250, 1024, 768, -1, $GUI_WS_EX_PARENTDRAG)
GUISetState(@SW_SHOW, $Form1)
GUISetState(@SW_SHOW, $Form2)

InetGet('http://dota.ru/3d/big/p324_42.jpg', @TempDir & '\~test.jpg')
GUICtrlSetImage($Pic1, @TempDir & '\~test.jpg')
GUICtrlSetImage($Pic2, @TempDir & '\~test.jpg')
FileDelete(@TempDir & '\~test.jpg')

WinSetTrans($Form1, '', 140)

Do
Until GUIGetMsg() = -3

Func WM_MOVE($hWnd, $iMsg, $wParam, $lParam)
    Switch $hWnd
        Case $Form1
            WinMove($Form2, '', BitAND($lParam, 0xFFFF), BitShift($lParam, 16))
        Case $Form2
            WinMove($Form1, '', BitAND($lParam, 0xFFFF) - 300, BitShift($lParam, 16))
    EndSwitch
    Return $GUI_RUNDEFMSG
EndFunc   ;==>WM_MOVE
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...