rliiack Posted November 2, 2009 Share Posted November 2, 2009 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 Link to comment Share on other sites More sharing options...
Yashied Posted November 2, 2009 Share Posted November 2, 2009 Why use _WinAPI_SetLayeredWindowAttributes() when there is a native AutoIt function - WinSetTrans()? My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
rliiack Posted November 2, 2009 Author Share Posted November 2, 2009 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 Link to comment Share on other sites More sharing options...
Yashied Posted November 2, 2009 Share Posted November 2, 2009 #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 My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
rliiack Posted November 2, 2009 Author Share Posted November 2, 2009 Thanks! I was also wondering about only transparenting part of an image. Is it possible to do it with WinSetTrans() too? My Projects:Smart Icons Link to comment Share on other sites More sharing options...
Yashied Posted November 2, 2009 Share Posted November 2, 2009 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 My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... 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