Sign in to follow this  
Followers 0
James

Transparent Background - Solid Icons

9 posts in this topic




You could make a GUI tranparent and create other smaller GUIs with the icons/labels/buttons you want.

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

I don't see how it would look tidy either way or vice versa.

Edited by JustinReno

Share this post


Link to post
Share on other sites

Is this it?

Dll and bitmap needed (below)

; EXAMPLE SHOWING Bitmap to Region function ( BMP2RGN() )
;
; int BMP2RGN("str","path to BMP",
;    "int",red value,
;    "int",green value,
;    "int",blue value)
;
; The red, green, blue values should be the color of the pixel
; in the BMP that you DON't want to see.
;
#include <GUIConstants.au3>

$gui = GUICreate("",100,100,-1,-1, $WS_POPUP)
GUICtrlCreatePic("larry.bmp",0,0,100,100)
GUICtrlSetState(-1, $GUI_DISABLE)
$Button = GUICtrlCreateButton("button", 15, 40, 70, 20)
$a = DLLCall("BMP2RGN.dll","int","BMP2RGN", _
            "str","larry.bmp", _
            "int",0, _
            "int",0, _
            "int",0)
SetWindowRgn($gui, $a[0])
GUISetState(@SW_SHOW)
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $Button
            Exit
    EndSelect
WEnd

Func SetWindowRgn($h_win, $rgn)
    DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $h_win, "long", $rgn, "int", 1)
EndFunc

larry.bmp

BMP2RGN.dll

Share this post


Link to post
Share on other sites

Thanks, I shall try that now.

Edit: Brilliant, but how do I change the transparency level?

I don't know if that's possible. Maybe something in the DLL. Ask Larry.

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

Hello,

i've got a problem here. on some machines the black part of the image is still displayed. and i got no errors from the DLLCall(...) but

the handle to the region is equal to 0

; EXAMPLE SHOWING Bitmap to Region function ( BMP2RGN() )
;
; int BMP2RGN("str","path to BMP",
;   "int",red value,
;   "int",green value,
;   "int",blue value)
;
; The red, green, blue values should be the color of the pixel
; in the BMP that you DON't want to see.
;
#include <GUIConstants.au3>

$gui = GUICreate("",100,100,-1,-1, $WS_POPUP)
GUICtrlCreatePic("larry.bmp",0,0,100,100)
GUICtrlSetState(-1, $GUI_DISABLE)
$Button = GUICtrlCreateButton("button", 15, 40, 70, 20)
$a = DLLCall("BMP2RGN.dll","int","BMP2RGN", _
            "str","larry.bmp", _
            "int",0, _
            "int",0, _
            "int",0)
MsgBox(1,"Info","region handle = "&$a[0] )
SetWindowRgn($gui, $a[0])
GUISetState(@SW_SHOW)
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $Button
            Exit
    EndSelect
WEnd

Func SetWindowRgn($h_win, $rgn)
    DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $h_win, "long", $rgn, "int", 1)
EndFunc

Any idea ?

Edited by voldor

Share this post


Link to post
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
Sign in to follow this  
Followers 0