Jump to content
Sign in to follow this  
loveau3

How to remove the white border

Recommended Posts

loveau3

******************************************************************************************

I hope every one willing to answer my questions friend please yourself first try

Run the script in reply. . Otherwise the answer is not take.

Not a little effect. . This problem will never answer the questions can not be resolved. . Please try again. Thank you

******************************************************************************************

How to replace the BMP files into PNG files (FOR icons UDF Attention)

How to remove the white border for png

Thanks !!~~~

ICONS.au3 UDF download in here!

http://yashied.narod2.ru/ProjectFiles/Miscellaneous/Icons_Hover.zip

post-57811-12751140738282_thumb.jpg

#Include <GUIConstantsEx.au3>

#Include <UDFs\GUICtrlSetOnHover.au3>
#Include <UDFs\Icons.au3>

Opt('MustDeclareVars', 0)

Global $Hold = False

$hForm = GUICreate('GUICtrlSetOnHover & Icons UDFs Demonstration', 1050, 500,-1, -1, $WS_POPUP)
$Back = GUICtrlCreatePic('', 0, 0, 1050, 500);;;;;;;here i want to use PNG file
_SetImage($Back, @ScriptDir & '\Images\background.png')
GUICtrlSetState(-1, $GUI_DISABLE)

GUIRegisterMsg($WM_NCHITTEST, "WM_NCHITTEST")

$ButtonPrev = GUICtrlCreatePic('', 452, 370, 64, 64)
GUICtrlSetOnHover(-1, '_Hover', '_Leave', '_Down', '_Up')
$ButtonNext = GUICtrlCreatePic('', 535, 370, 64, 64)
GUICtrlSetOnHover(-1, '_Hover', '_Leave', '_Down', '_Up')
$Pic1 = GUICtrlCreatePic('', 82, 70, 256, 256)
GUICtrlSetOnHover(-1, '_Hover', '_Leave')
$Pic2 = GUICtrlCreatePic('', 397, 70, 256, 256)
GUICtrlSetOnHover(-1, '_Hover', '_Leave')
$Pic3 = GUICtrlCreatePic('', 712, 70, 256, 256)
GUICtrlSetOnHover(-1, '_Hover', '_Leave')

For $i = $ButtonPrev To $Pic3
    _Leave($i)
Next

GUISetState()

Do
Until GUIGetMsg() = -3

Func _Down($CtrlID)

    If $Hold Then
        Return
    Else
        $Hold = True
    EndIf

    Local $File

    Switch $CtrlID
        Case $ButtonPrev
            $File = 'button_prev_down.png'
        Case $ButtonNext
            $File = 'button_next_down.png'
    EndSwitch
    _SetImage($CtrlID, @ScriptDir & '\Images\' & $File, $Back)
EndFunc   ;==>_Down

Func _Leave($CtrlID)

    Local $File

    Switch $CtrlID
        Case $ButtonPrev
            $File = 'button_prev.png'
        Case $ButtonNext
            $File = 'button_next.png'
        Case $Pic1
            $File = 'pic1.png'
        Case $Pic2
            $File = 'pic2.png'
        Case $Pic3
            $File = 'pic3.png'
    EndSwitch
    _SetImage($CtrlID, @ScriptDir & '\Images\' & $File, $Back)
    $Hold = False
EndFunc   ;==>_Leave

Func _Hover($CtrlID)

    Local $File

    Switch $CtrlID
        Case $ButtonPrev
            $File = 'button_prev_hover.png'
        Case $ButtonNext
            $File = 'button_next_hover.png'
        Case $Pic1
            $File = 'pic1_hover.png'
        Case $Pic2
            $File = 'pic2_hover.png'
        Case $Pic3
            $File = 'pic3_hover.png'
    EndSwitch
    _SetImage($CtrlID, @ScriptDir & '\Images\' & $File, $Back)
    $Hold = False
EndFunc   ;==>_Hover

Func _Up($CtrlID)
    _Hover($CtrlID)
EndFunc   ;==>_Up


Func WM_NCHITTEST($hWnd, $iMsg, $iwParam, $ilParam)
    If ($hWnd = $hForm) And ($iMsg = $WM_NCHITTEST) Then Return $HTCAPTION
EndFunc   ;==>WM_NCHITTEST

background PNG file

post-57811-12751145610138_thumb.png

Edited by loveau3

Share this post


Link to post
Share on other sites
CodyBarrett

Use

$WS_EX_LAYERED?

$WS_EX_TRANSPARENT?

those has helped me in the past with PNGs on GUIs

Share this post


Link to post
Share on other sites
MvGulik
whatever Edited by MvGulik

"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

Share this post


Link to post
Share on other sites
loveau3

Use

$WS_EX_LAYERED?

$WS_EX_TRANSPARENT?

those has helped me in the past with PNGs on GUIs

Boss. . Please try this result can not achieve what I want

Share this post


Link to post
Share on other sites
CodyBarrett

is your PNG with a transparent background or is it a white one? maybe its the pictures problem and not the code.

Share this post


Link to post
Share on other sites
loveau3

is your PNG with a transparent background or is it a white one? maybe its the pictures problem and not the code.

Well then you can try it?

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.