SkellySoul Posted December 27, 2009 Posted December 27, 2009 Hey Everyone I have ran in to a problem and am not exactly sure what I can do about it.#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $GUI_Width = 800 $GUI_Height = 800 $Path = @ScriptDir & "\" $Main_GUI = GUICreate("", $GUI_Width, $GUI_Height , Default , Default , $WS_POPUP , $WS_EX_LAYERED) GUICtrlCreatePic($Path & "Vis.Gif" , 0 , 0 , $GUI_Width , $GUI_Height) GUICtrlCreatePic($Path & "Frame.gif", 0, 0, 415, 338) GUICtrlCreatePic($Path & "Ext_Frame.gif", 257, 257, 315, 257) GUISetState(@SW_SHOW) While 1 $Msg = GUIGetMsg() Switch $Msg Case $GUI_EVENT_CLOSE Exit EndSwitch WEndExample: This is how it should look and the other picture is how it does look.Note: 0xFF00FF is used as the transparent colorImages are included so you can play around with it yourself.Please Help Me
ichigo325 Posted December 27, 2009 Posted December 27, 2009 Hi, i tried your code.. I found 2 solution.. First example, #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $GUI_Width = 800 $GUI_Height = 800 $Path = @ScriptDir & "\" $Main_GUI = GUICreate("", $GUI_Width, $GUI_Height , Default , Default , $WS_POPUP , $WS_EX_LAYERED) GUICtrlCreatePic($Path & "Vis.Gif" , 0 , 0 , $GUI_Width , $GUI_Height) GUICtrlCreatePic($Path & "Frame.gif", 0, 0, 415, 338) GUICtrlCreatePic($Path & "Ext_Frame.gif", 270, 270, 315, 257) ;change the x and y position GUISetState(@SW_SHOW) While 1 $Msg = GUIGetMsg() Switch $Msg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Second example, used gdi+ (png format).. This works perfect but the picture is small! expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GDIPlus.au3>;used gdi+ $GUI_Width = 800 $GUI_Height = 800 $Path = @ScriptDir & "\" $Main_GUI = GUICreate("", $GUI_Width, $GUI_Height , Default , Default , $WS_POPUP , $WS_EX_LAYERED) _GDIPlus_StartUp() $hImage = _GDIPlus_ImageLoadFromFile("D:\Frame.png") $hImage2 = _GDIPlus_ImageLoadFromFile("D:\Ext_Frame.png") $hGraphic = _GDIPlus_GraphicsCreateFromHWND($Main_GUI) GUICtrlCreatePic($Path & "Vis.Gif" , 0 , 0 , $GUI_Width , $GUI_Height) ;~ GUICtrlCreatePic($Path & "Frame.gif", 0, 0, 415, 338) ;~ GUICtrlCreatePic($Path & "Ext_Frame.gif", 257, 257, 315, 257) GUIRegisterMsg($WM_PAINT, "MY_WM_PAINT") GUISetState(@SW_SHOW) While 1 $Msg = GUIGetMsg() Switch $Msg Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_ImageDispose($hImage) _GDIPlus_ShutDown() Func MY_WM_PAINT($hWnd, $Msg, $wParam, $lParam) _WinAPI_RedrawWindow($Main_GUI, 0, 0, $RDW_UPDATENOW) _GDIPlus_GraphicsDrawImage($hGraphic, $hImage, 0, 0) _GDIPlus_GraphicsDrawImage($hGraphic, $hImage2, 150, 110) _WinAPI_RedrawWindow($Main_GUI, 0, 0, $RDW_VALIDATE) Return $GUI_RUNDEFMSG EndFunc [size="2"][font="Lucida Sans Unicode"][b][/b][/font][/size]
martin Posted December 27, 2009 Posted December 27, 2009 One way is to have 2 windows. Then you have to have some way of keeping the positions correct if one window is moved, so you could register $WM_MOVE. expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $GUI_Width = 800 $GUI_Height = 800 Global Const $WM_ENTERSIZEMOVE = 0x231, $WM_EXITSIZEMOVE = 0x232 $Path = @ScriptDir & "\" $Main_GUI = GUICreate("", $GUI_Width, $GUI_Height , default, default, $WS_POPUP , $WS_EX_LAYERED) GUISetBkColor(0xFF00FF) ;GUICtrlCreatePic($Path & "Vis.Gif" , 0 , 0 , $GUI_Width , $GUI_Height) GUICtrlCreatePic($Path & "Frame.gif", 0, 0, 415, 338,-1, $GUI_WS_EX_PARENTDRAG) GUISetState(@SW_SHOW) $gp = wingetpos($Main_GUI) $SEc_GUI = GUICreate("", $GUI_Width, $GUI_Height , default, default, $WS_POPUP ,$WS_EX_LAYERED) GUISetBkColor(0xFF00FF) GUICtrlCreatePic($Path & "Ext_Frame.gif", 257, 257, 315, 257);,-1, $GUI_WS_EX_PARENTDRAG) GUISetState(@SW_SHOW) Global $RelPos[2] GUIRegisterMsg($WM_ENTERSIZEMOVE, "setrelpos") GUIRegisterMsg($WM_MOVE, "followme") While 1 $Msg = GUIGetMsg() Switch $Msg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func followme($hW, $iM, $wp, $lp) If $hW <> $Main_GUI Then Return Local $xpos = BitAND($lp, 0xffff) Local $ypos = BitShift($lp, 16) Local $xypos = WinGetPos($Main_GUI) WinMove($SEc_GUI, "", $xypos[0] - $RelPos[0], $xypos[1] - $RelPos[1]) EndFunc ;==>followme Func SetRelPos($hW, $iM, $wp, $lp) If $hW <> $Main_GUI Then Return Local $gpp = WinGetPos($Main_GUI) Local $gsp = WinGetPos($Main_GUI) $RelPos[0] = $gpp[0] - $gsp[0] $RelPos[1] = $gpp[1] - $gsp[1] EndFunc ;==>SetRelPos Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Yashied Posted December 27, 2009 Posted December 27, 2009 Another way (easiest).#Include <GUIConstantsEx.au3> #Include <Icons.au3> #Include <WindowsConstants.au3> $GUI_Width = 800 $GUI_Height = 800 $Path = @ScriptDir & "\" $Main_GUI = GUICreate("", $GUI_Width, $GUI_Height, Default, Default, $WS_POPUP, $WS_EX_LAYERED) GUICtrlCreatePic('', 0, 0, $GUI_Width, $GUI_Height) _SetImage(-1, $Path & "Vis.png") GUICtrlCreatePic('', 0, 0, 415, 338) _SetImage(-1, $Path & "Frame.png") GUICtrlCreatePic('', 257, 257, 315, 257) _SetImage(-1, $Path & "Ext_Frame.png") GUISetState(@SW_SHOW) While 1 $Msg = GUIGetMsg() Switch $Msg Case $GUI_EVENT_CLOSE Exit EndSwitch WEndIcons.au3, Images.zip 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...
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