Jump to content

Recommended Posts

Posted

I've search the forum and saw the transparency on png file and know that I can use _WinAPI_SetLayeredWindowAttributes to make it partially transparent. I am wondering if I can do the same thing to bitmap images.

My Projects:Smart Icons

Posted

Oh... That works too, thanks. The first example I saw uses _WinAPI_SetLayeredWindowAttributes. So my problem now becomes, how to treat a bitmap image as a window?

My Projects:Smart Icons

Posted

#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

Posted

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

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
  • Recently Browsing   0 members

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