xroot Posted February 12, 2010 Posted February 12, 2010 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
picea892 Posted February 12, 2010 Posted February 12, 2010 Oh, that is very nice, very simple. That beats using a layered window or clipping controls or shaping GUIs.
taurus905 Posted February 14, 2010 Posted February 14, 2010 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
JohnOne Posted February 14, 2010 Posted February 14, 2010 pretty cool that. thanks for the share. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
Fire Posted February 14, 2010 Posted February 14, 2010 (edited) xroot excellent work dude.Thank you very-very much5 stars from me Edited May 9, 2010 by Fire [size="5"] [/size]
Moderators Melba23 Posted February 15, 2010 Moderators Posted February 15, 2010 (edited) xroot, Nice job with the DLL. 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): expandcollapse popup#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. M23 Edit: To clarify that I was only offering an alternative solution, not criticizing the OP's work in any way. Edited February 15, 2010 by Melba23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
picea892 Posted February 15, 2010 Posted February 15, 2010 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)
Moderators Melba23 Posted February 15, 2010 Moderators Posted February 15, 2010 picea892, Very true. 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 Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
picea892 Posted February 15, 2010 Posted February 15, 2010 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
xroot Posted February 15, 2010 Author Posted February 15, 2010 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. expandcollapse popupGlobal 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 WEndbmps.zip
lsakizada Posted February 16, 2010 Posted February 16, 2010 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)!
slayerz Posted April 28, 2010 Posted April 28, 2010 Thanks Xroot. This will add more option to skin the GUI. Currently I'm using SkinCrafter but I'm looking something like this AUTOIT[sup] I'm lovin' it![/sup]
mesale0077 Posted September 23, 2010 Posted September 23, 2010 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
tomashen Posted November 26, 2011 Posted November 26, 2011 (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 November 26, 2011 by tomashen Proud of AutoIt Proud of MySelf :)
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now