Sign in to follow this  
Followers 0
xroot

Make simple skins out of your bmp's.

16 posts in this topic

My Makeskin.dll is simple to use.

Call it with the GUICreate handle, and string pointer of your bmp.

It returns the handle of the bmp.

If your bmp's are bigger than default(400) width,height then change it from -1 in GUICreate.

To make your BMP's work, all you have to do is set a color for the mask. A color not in the

BMP. Look at the 3 BMP's I changed. Two of them have magenta other has grey color mask.

Run the sample program, it will give you the idea on what you can do.

sskins.zip

Share this post


Link to post
Share on other sites



Oh, that is very nice, very simple. That beats using a layered window or clipping controls or shaping GUIs.

Share this post


Link to post
Share on other sites

xroot,

This is really cool.

Thanks for sharing your hard work.

taurus905


"Never mistake kindness for weakness."-- Author Unknown --"The highest point to which a weak but experienced mind can rise is detecting the weakness of better men."-- Georg Lichtenberg --Simple Obfuscator (Beta not needed.), Random names for Vars and Funcs

Share this post


Link to post
Share on other sites

No prob.

Thanks

Share this post


Link to post
Share on other sites

yes :mellow: , i like it :( thanks..

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

xroot excellent work dude.

Thank you very-very much

5 stars from me

Edited by Fire

[size="5"] [/size]

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

xroot,

Nice job with the DLL. :mellow:

But I thought I would point out to less-experienced forum members that you do not have to use it to get shaped GUIs. :( AutoIt can produce GUIs directly from BMPs using only built-in commands (I have used the BMPs you included in your zip):

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <SendMessage.au3>

Global Const $SC_DRAGMOVE = 0xF012

Global $aSize[2], $aImages[3][7] = [["\Pen.bmp",    323, 382, 230, 300, 25, 295], _
                                    ["\fbi.bmp",    340, 400, 255, 368, 50, 368], _
                                    ["\kkitty.bmp", 452, 400, 222, 284,  0,   0]]

For $i = 0 To 2
    _GUI_Image($i)
Next

Exit

Func _GUI_Image($i)

    Local $hTestButton

    Local $hGUI = GUICreate("No DLL Required", $aImages[$i][1], $aImages[$i][2], -1, -1, $WS_POPUP, $WS_EX_LAYERED)
    GUICtrlCreatePic(@ScriptDir & $aImages[$i][0], 0, 0, $aImages[$i][1], $aImages[$i][2])
    GUICtrlSetState(-1, $GUI_DISABLE)

    If $i < 2 Then
        $hTestButton = GUICtrlCreateButton("Next BMP", $aImages[$i][5], $aImages[$i][6], 70, 30)
        GUICtrlSetFont(-1, 10, 800, 0, "Arial")
    Else
        $hTestButton = 9999
    EndIf
    Local $hExitButton = GUICtrlCreateButton("E x i t", $aImages[$i][3], $aImages[$i][4], 55, 25, 1)
    GUICtrlSetFont(-1, 12, 800, 0, "Arial")

    GUISetState(@SW_SHOW)

    While 1

        Switch GUIGetMsg()
            Case $hExitButton
                Exit
            Case $hTestButton
                MsgBox(0, "Next", "Next GUI ready when you are!")
                GUIDelete($hGUI)
                ExitLoop
            Case $GUI_EVENT_PRIMARYDOWN
                _SendMessage($hGUI, $WM_SYSCOMMAND, $SC_DRAGMOVE, 0)
        EndSwitch

    WEnd

EndFunc

I hard-coded the BMP size (which you could get through GDI) and the positions of the buttons to make the script easier to loop.

Anyway, nice work with the DLL - looking forward to your next project. :lol:

M23

Edit: To clarify that I was only offering an alternative solution, not criticizing the OP's work in any way.

Edited by Melba23

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

But it's not clipped like xroots is....I see value here even if you don't. Change this line in your script and you'll see what I mean

$hTestButton = GUICtrlCreateButton("Next BMP", 0, 0, 70, 30)

Share this post


Link to post
Share on other sites

picea892,

Very true. :mellow:

But, as I hoped you noticed, I was very careful not to criticise or belittle xroot's work. I was merely offering another way to produce essentially the same result - without the need for an external DLL or the (relatively short) delay while it does its magic. My only purpose was to show some of the less experienced members here that the external DLL method was not the only way to go about producing a shaped GUI and that there are often many solutions to a given problem. . :(

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

My mistake. Reread your comment and you weren't being critical just giving an alternative.....and a very good alternative may I add.

Have a good day

Picea

Share this post


Link to post
Share on other sites

Melba23,

I was not offended by your example, the funny thing is I had done what you did but got frustrated not getting things to work properly,

so I created the Dll.

Here is what I was working on before I made the Dll.

When I use the Pic control the GUI ignores the WS_EX_LAYERED, if I use Button control then no transparency no blending.

Anyway, thanks for your input.

Global Const $WM_POPUP=0x80000000
Global Const $WS_EX_CONTROLPARENT=0x00010000
Global Const $GUI_WS_EX_PARENTDRAG=0x00100000
Global Const $WS_EX_LAYERED=0x00080000
Global Const $GUI_DISABLE=128
Global Const $BS_BITMAP=0x0081
Global Const $TRANSPARENT=-2
Global Const $LR_LOADFROMFILE=16

Func Get_WH($iFile,$iType=0)
    Local $BM=DllStructCreate("int;int;int;int;word;word;ptr")
    Local $ret=DllCall("user32.dll","hwnd","LoadImage","hwnd",0, _
                                                       "str",$iFile, _
                                                       "int",$iType, _  ;1=IMAGE_ICON 0=Bmp
                                                       "int",0, _
                                                       "int",0, _
                                                       "int",$LR_LOADFROMFILE)
    DllCall("GDI32.dll","int","GetObject","hwnd",$ret[0], _
                                          "int",DllStructGetSize($BM), _
                                          "ptr",DllStructGetPtr($BM))
    Global $W=DllStructGetData($BM,2)
    Global $H=DllStructGetData($BM,3)
    $BM=0
    Return
EndFunc

Local $BG="C:\My Documents\Images\Skins\face.bmp"
Local $ExitBmp="C:\My Documents\Images\exit.bmp"
Local $xBmp="C:\My Documents\Images\Buttons\XU.bmp"
Local $MinBmp="C:\My Documents\Images\Buttons\MinU.bmp"

Get_WH($BG)
$hWnd=GUICreate("***",$W,$H,-1,-1,$WM_POPUP,$WS_EX_LAYERED+$WS_EX_CONTROLPARENT)
$mBG=GUICtrlCreatePic($BG,0,0,$W,$H)
GUICtrlSetState(-1,$GUI_DISABLE)

Get_WH($xBmp)
;$X=GUICtrlCreateButton("",434,9,$W,$H,$BS_BITMAP) ; This works but ugly. No transp.
$X=GUICtrlCreatePic($xBmp,434,9,$W,$H) ;****This is what I can not get to work.
;GUICtrlSetImage(-1,$xBmp)

Get_WH($MinBmp)
$Min=GUICtrlCreatePic("",416,9,$W,$H)
GUICtrlSetImage(-1,$MinBmp)

Get_WH($ExitBmp)
$Exit=GUICtrlCreateButton("",375,185,$W,$H,$BS_BITMAP)
GUICtrlSetImage(-1,$ExitBmp)

GUICtrlCreateLabel("Skinned",20,9,72,14,1,$GUI_WS_EX_PARENTDRAG)
GUICtrlSetFont(-1,11,800,0,"Arial")
GUICtrlSetBkColor(-1,$TRANSPARENT)
GUICtrlSetColor(-1,0xFFFFFF)

GUISetState()

While True
    Switch GUIGetMsg()
        Case -3,$Exit,$X
            Exit
        Case $Min
            GUISetState(@SW_MINIMIZE)
    EndSwitch
WEnd

bmps.zip

Share this post


Link to post
Share on other sites

Well done Xroot.

Can I use the dll on my project?

BTW, how do you create such BMP file for the skin?

Thanks for sharing


Be Green Now or Never (BGNN)!

Share this post


Link to post
Share on other sites

Thanks Xroot. This will add more option to skin the GUI. Currently I'm using SkinCrafter but I'm looking something like this :idea:


AUTOIT[sup] I'm lovin' it![/sup]

Share this post


Link to post
Share on other sites

Well done Xroot.

Thank you very-very much

but this bmp file ,with this your my makeskindll file,bmp file How can we make gif or png ,out.gif or out.png

how background color as cleared,out file out.gif or out.png

again Thank you very-very much

Share this post


Link to post
Share on other sites

#16 ·  Posted (edited)

umm also can any1 tell me how to save .bmp so taht u get the pink around the image? o.o

im using photoshop cs3

my problem is taht when i save an image .bmp ..

and then the gui shows white lines around the image which makes the img look crappy.. :/

Edited by tomashen

Proud of AutoIt Proud of MySelf :)

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