Jump to content

Transparent Background - Solid Icons


James
 Share

Recommended Posts

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

Link to comment
Share on other sites

  • 1 month later...

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