Jump to content

Gui with transparent parts


Recommended Posts

I'm trying to make a program that includes a background pic. The GUI then "adjusts" itself to the pic shape, that is, pink parts of the background pic become transparent. I'm doing this using $WS_EX_LAYERED on the GUI. However when I put other pic on top of the background one the pink parts show up again.

I'd like to make the window have transparent parts and then simulate a title bar that could be dragged.

#include <GUIConstants.au3>

$gui = GUICreate ( "AK-Manager, by Abilio_KID", 640, 480, -1, -1, $WS_POPUP, $WS_EX_LAYERED )
$background = GUICtrlCreatePic ("Gui\Background.bmp", 0, 0, 640, 480 )
$title = GUICtrlCreatePic ("Gui\Title.bmp", 45, 3, 496, 20, -1, $GUI_WS_EX_PARENTDRAG )
GUISetState (@SW_SHOW)

While 1
    $msg = GUIGetMsg()  
    If $msg = $GUI_EVENT_CLOSE Then Exit
Wend

If I do this then I can't even drag the window using the title bar pic. Isn't there a simple way of doing this without using some API call? Btw, isn't there proper MDI child window support?

Link to comment
Share on other sites

Isn't there a simple way of doing this without using some API call?

I'd like to do it only using AutoIt code and not another external DLL. Actually, if that's so simple why isn't there a command like that in AutoIt itself?

I never liked the idea of using DLL's or plugins with my app. I prefer the user clicks single exe and never has to worry about missing DLL's and stuff. Of course I could "install" the DLL temporarily but that's not what i want to.

Tbh what I want to know is why this works with a single picture (I can use the bitmap and the transparency works) but if I put another picture on top of it then it doesn't work anymore.

Is it just me or this forum has seen better days?

Link to comment
Share on other sites

I'd like to do it only using AutoIt code and not another external DLL. Actually, if that's so simple why isn't there a command like that in AutoIt itself?

I never liked the idea of using DLL's or plugins with my app. I prefer the user clicks single exe and never has to worry about missing DLL's and stuff. Of course I could "install" the DLL temporarily but that's not what i want to.

think you'll find in any language in order to do this you'll have to do api calls, that's what larry's dll does for you.

Tbh what I want to know is why this works with a single picture (I can use the bitmap and the transparency works) but if I put another picture on top of it then it doesn't work anymore.

You'll recieve more help/input if you provide a short script/files to reproduce the problem.

Is it just me or this forum has seen better days?

just you. :D

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

Tip: put the dll call as a command inside AutoIt code, simple as that. If not then provide a similar way of doing it with just AutoIt commands.

I already gave you an example. I create a layered window (GUI) then a pic control I apply as the background. Pink parts of the pic become transparent and I can use the pic as a way of dragging the window.

Now if I add another pic control as the title bar, make it the one that drags the window and not the background then the background pic looses the transparent parts (they become visible).

As for the forum it's the usual in any forum at all. If I don't reply enough and people don't usually know me then they simply don't reply at all. :D

Link to comment
Share on other sites

I use AutoIt for simple and quick app's. I'm not a programmer but I have done some nice small app's with AutoIt to help me in my day-to-day needs.

Icekirby1, I'm giving a the developpers a tip on a simple thing to improve AutoIt GUI functionality. Take a look at Larry's dll, it's very small and shouldn't be hard to implement. For me not replying at all is a lot worse then double posting, but that's just me.

All programs use API calls somehow. Would be nice to do it inside AutoIt.

For now I'll try Larry's DLL call and wait for something better.

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