Jump to content

Transparent Image GUI?


JohnWang
 Share

Recommended Posts

Hello~

I have a question regrading the possibility of Creating a GUI which only display Image as the main visual instead of the title bar and the typial background behind it. If my explaination doesnt make sense take a look at the attached file below. As you can see the "cat" :( is stand alone by itself without the window as its background which is what ill get if i create the window with GUICreate and puts the picture on it with GUIctrlCreatePic. This is just a question out of curiosity as i "tries' to make a desktop animation program for fun. I understand that AutoIt is still growin :lmao: and this might be out of the scope for it or mebe the same question have already been asked just tell me so. anyways thanks for anyhelp in advance.. :P

Edit: i look though the forum again and i found the post: http://www.autoitscript.com/forum/index.php?showtopic=17230 Larry's example does exactly what i wanted but instead of text with pictures. Just providing a bit more information for those who intended to help me =) P.S. "then why not just use Larry's example and modify this and that and u got urself a workin script?!" lol im too noob to play around with DllCall related script ..sorry O-o... hope some1 can help me Thanks again

Edited by Jon
Link to comment
Share on other sites

if you modify slight bit the example2 of GUICtrlCreatePic you get your answer

#include "GUIConstants.au3"

;$gui=GUICreate("test transparentpic", 200, 100)
$pic=GUICreate("", 68, 71, 10, 10,$WS_POPUP,BitOr($WS_EX_LAYERED,0))                ;,$WS_EX_MDICHILD),$gui)
GUICtrlCreatePic(@Systemdir & "\oobe\images\merlin.gif",0,0, 0,0)

GUISetState(@SW_SHOW,$pic)
;GUISetState(@SW_SHOW,$gui)

HotKeySet("{ESC}", "main")
HotKeySet("{LEFT}", "left")
HotKeySet("{RIGHT}", "right")
HotKeySet("{DOWN}", "down")
HotKeySet("{UP}", "up")
$picPos = WinGetPos($pic)
;$guiPos = WinGetPos($gui)

do
    $msg = GUIGetMsg()
until $msg = $GUI_EVENT_CLOSE
Exit

Func main()
    $guiPos = WinGetPos($gui)
    WinMove($gui,"",$guiPos[0]+10,$guiPos[1]+10)
EndFunc

Func left ()
    $picPos = WinGetPos($pic)
    WinMove($pic,"",$picPos[0]-10,$picPos[1])
EndFunc

Func right()
    $picPos = WinGetPos($pic)
    WinMove($pic,"",$picPos[0]+10,$picPos[1])
EndFunc

Func down()
    $picPos = WinGetPos($pic)
    WinMove($pic,"",$picPos[0],$picPos[1]+10)
EndFunc

Func up()
    $picPos = WinGetPos($pic)
    WinMove($pic,"",$picPos[0],$picPos[1]-10)
EndFunc

The doc is saying how to have transparent on a given window so Child is needed, but you are by default the child of the desktop window. :P

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...