I was wondering if there is a simpler way to do this and if there is I'd appreciate it if someone told me because I'm wondering if there is a way to do this with no more than 4 or 5 lines of code.
Please help!
Posted 07 August 2008 - 06:20 PM
Posted 07 August 2008 - 06:44 PM
Here you go...I really need to be able to put .pngs in my program and I've read the topics showing how to do this but it seems like a LONG DRAWN OUT process that will take a lot of code and a lot of time.
I was wondering if there is a simpler way to do this and if there is I'd appreciate it if someone told me because I'm wondering if there is a way to do this with no more than 4 or 5 lines of code.
Please help!
PNGUDF.zip 1.11KB
409 downloads
Posted 07 August 2008 - 06:55 PM
Posted 07 August 2008 - 07:02 PM
Is the link in my post broken? I do not longer own my domain, all the files are moved to my new domain.Example: http://monoceres.se/test.au3 -> http://andhen.mine.nu/monoceres.se/test.au3
Posted 07 August 2008 - 07:05 PM
Wow this is great!!! Thanks!
![]()
Btw, what do you mean when you say the coding of all the buttons takes all the time.
And what if I want to create more than one png? Windows won't let me have 10 or so images called background.png
Posted 07 August 2008 - 07:06 PM
Posted 07 August 2008 - 07:12 PM
Monceres,
whenever I would move the window containing the png a black shadow would expand around it up to about 20 pixels.
If that wouldnt have happened, i wouldnt have started this thread...
Is the link in my post broken? I do not longer own my domain, all the files are moved to my new domain.Example: http://monoceres.se/test.au3 -> http://andhen.mine.nu/monoceres.se/test.au3
Posted 07 August 2008 - 09:09 PM
Edited by IWantIt, 07 August 2008 - 09:09 PM.
Posted 08 August 2008 - 01:08 AM
Posted 09 August 2008 - 05:37 PM
Posted 10 August 2008 - 05:02 AM
Posted 10 August 2008 - 05:09 AM
Posted 10 August 2008 - 05:25 AM
#include <GDIPlus.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> #include <GuiConstantsEx.au3> Global Const $AC_SRC_ALPHA = 1 Global $hImage, $gui1, $controlGui Func CreateTransparentGUI($Title) ;if FileExists(@ScriptDir & '\grey.gif') = 0 then _GDIPlus_Startup() For $i=1 to 15 $hImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\Background" & $i & ".png") Next $ImageHeight = _GDIPlus_ImageGetHeight($hImage) $ImageWidth = _GDIPlus_ImageGetWidth($hImage) $gui1 = GUICreate($Title, $ImageWidth, $ImageHeight, -1, -1, $WS_popup, $WS_EX_LAYERED) SetBitMap($gui1, $hImage, 255) GUISetState() $controlGui = GUICreate("ControlGUI", $ImageWidth, $ImageHeight, -1, -1, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_MDICHILD), $GUI1) GUICtrlCreatePic(@ScriptDir & "\grey2.gif", 0, 0, $ImageWidth, $ImageHeight) GUICtrlSetState(-1, $GUI_DISABLE) GUISetState() GUIRegisterMsg($WM_NCHITTEST, "WM_NCHITTEST") EndFunc Func WM_NCHITTEST($hWnd, $iMsg, $iwParam, $ilParam) if ($hWnd = $gui1) and ($iMsg = $WM_NCHITTEST) then Return $HTCAPTION EndFunc Func SetBitmap($hGUI, $hImage, $iOpacity) Local $hScrDC, $hMemDC, $hBitmap, $hOld, $pSize, $tSize, $pSource, $tSource, $pBlend, $tBlend $hScrDC = _WinAPI_GetDC(0) $hMemDC = _WinAPI_CreateCompatibleDC($hScrDC) $hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage) $hOld = _WinAPI_SelectObject($hMemDC, $hBitmap) $tSize = DllStructCreate($tagSIZE) $pSize = DllStructGetPtr($tSize ) DllStructSetData($tSize, "X", _GDIPlus_ImageGetWidth ($hImage)) DllStructSetData($tSize, "Y", _GDIPlus_ImageGetHeight($hImage)) $tSource = DllStructCreate($tagPOINT) $pSource = DllStructGetPtr($tSource) $tBlend = DllStructCreate($tagBLENDFUNCTION) $pBlend = DllStructGetPtr($tBlend) DllStructSetData($tBlend, "Alpha" , $iOpacity ) DllStructSetData($tBlend, "Format", $AC_SRC_ALPHA) _WinAPI_UpdateLayeredWindow($hGUI, $hScrDC, 0, $pSize, $hMemDC, $pSource, 0, $pBlend, $ULW_ALPHA) _WinAPI_ReleaseDC (0, $hScrDC) _WinAPI_SelectObject($hMemDC, $hOld) _WinAPI_DeleteObject($hBitmap) _WinAPI_DeleteDC ($hMemDC) EndFunc
Posted 10 August 2008 - 05:50 AM
NextBG() Global $bgcount=1 Func NextBG() $hImage = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\Background" & $bgcount & ".png") $bgcount+=1 if $bgcount>15 then $bgcount=1; reset Endfunc
Posted 10 August 2008 - 06:04 AM
Posted 24 August 2008 - 05:56 PM
This was designed for a single PNG.
You would have to understand how the function worked to use more than one PNG=) Figure it out, otherwise just use normal windows for children or whatever=)
Edited by IWantIt, 13 September 2008 - 05:05 PM.
Posted 26 August 2008 - 08:40 PM
Posted 31 August 2008 - 04:36 PM
Posted 12 September 2008 - 04:12 PM
Edited by IWantIt, 12 September 2008 - 04:13 PM.
0 members, 0 guests, 0 anonymous users