yehia Posted February 13, 2009 Share Posted February 13, 2009 (edited) hi all this is my first example in autoit forum so please commentafter seeing andybiochem's topic about the elastic radio buttons following the mouse pointer i decided to create something for my GF using this func for valentine's dayHAPPY VALENTINE DAYok now to test this u will have to save the script then save the PNGs to a folder named "Set" in the script directoryand it should look like this :expandcollapse popup;====== Elastic Trail script ====== ; Original Javascript by Philip Winston - pwinston@yahoo.com ; Adapted for AutoIT by AndyBiochem ; Used with GDI+ for PNG's by yehia #include <WindowsConstants.au3> #include <GuiConstantsEx.au3> #include <GDIPlus.au3> ;----- Variables ----- Global $iDots = 7 ;..... Number of PNGs Global $aDots[$iDots][5] ;..... PNGs array Global $iXpos = 0 Global $iYpos = 0 Global $iDeltaT = 0.01 Global $iSegLen = 10 Global $iSpringK = 10 Global $iMass = 1 Global $iXGravity = 0 Global $iYGravity = 50 Global $iRes = 10 Global $iStopVel = 0.1 Global $iStopAcc = 0.1 Global $iDotSize = 25 Global $iBounce = 0.75 Global Const $AC_SRC_ALPHA = 1 Global $iHeight = @DesktopHeight Global $iWidth = @DesktopWidth ;----- 'PNGs' ----- Myname() ; just my name on the back :P For $i = 1 To ($iDots - 1) $iDotSize-=2 $aDots[$i][0] = GUICreate("", $iDotSize, $iDotSize, 144, 160, $WS_POPUP , $WS_EX_LAYERED + $WS_EX_TOOLWINDOW+$WS_EX_TOPMOST) _GDIPlus_Startup() $hImage = _GDIPlus_ImageLoadFromFile(@ScriptDir &"\Set\" &$i& ".png") SetBitMap($aDots[$i][0] , $hImage, 255) GUISetState(@SW_SHOW) Next ;############### LOOP ############### While 1 Sleep(10) $m = MouseGetPos() $iXpos = $m[0] $iYpos = $m[1] _Animate() WEnd ;#################################### Func _Animate() $aDots[0][1] = $iXpos $aDots[0][2] = $iYpos For $i = 1 To ($iDots - 1) Local $spring[3] $spring[1] = 0 $spring[2] = 0 _Spring_Force($i - 1, $i, $spring) If $i < ($iDots - 1) Then _Spring_Force($i + 1, $i, $spring) Local $resist[3] $resist[1] = -$aDots[$i][3] * $iRes $resist[2] = -$aDots[$i][4] * $iRes Local $accel[3] $accel[1] = ($spring[1] + $resist[1]) / $iMass + $iXGravity $accel[2] = ($spring[2] + $resist[2]) / $iMass + $iYGravity $aDots[$i][3] += ($iDeltaT * $accel[1]) $aDots[$i][4] += ($iDeltaT * $accel[2]) If Abs($aDots[$i][3]) < $iStopVel And Abs($aDots[$i][4]) < $iStopVel And Abs($accel[1]) < $iStopAcc And Abs($accel[2]) < $iStopAcc Then $aDots[$i][3] = 0 $aDots[$i][4] = 0 EndIf $aDots[$i][1] += $aDots[$i][3] $aDots[$i][2] += $aDots[$i][4] If ($aDots[$i][2] < 0) Then If ($aDots[$i][4] < 0) Then $aDots[$i][4] = $iBounce * - $aDots[$i][4] $aDots[$i][2] = 0 EndIf If ($aDots[$i][2] >= $iHeight - $iDotSize - 1) Then If ($aDots[$i][4] > 0) Then $aDots[$i][4] = $iBounce * - $aDots[$i][4] $aDots[$i][2] = $iHeight - $iDotSize - 1 EndIf If ($aDots[$i][1] >= $iWidth - $iDotSize) Then If ($aDots[$i][3] > 0) Then $aDots[$i][3] = $iBounce * - $aDots[$i][3] $aDots[$i][1] = $iWidth - $iDotSize - 1 EndIf If ($aDots[$i][1] < 0) Then If ($aDots[$i][3] < 0) Then $aDots[$i][3] = $iBounce * - $aDots[$i][3] $aDots[$i][1] = 0 EndIf WinMove($aDots[$i][0], "", $aDots[$i][1], $aDots[$i][2]) Next EndFunc ;==>_Animate Func _Spring_Force($i, $j, ByRef $spring) Local $springF $dx = $aDots[$i][1] - $aDots[$j][1] $dy = $aDots[$i][2] - $aDots[$j][2] $len = Sqrt($dx ^ 2 + $dy ^ 2) If Not ($len > $iSegLen) Then Return $springF = $iSpringK * ($len - $iSegLen) $spring[1] += ($dx / $len) * $springF $spring[2] += ($dy / $len) * $springF EndFunc ;==>_Spring_Force 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 ;==>SetBitmap Func Myname() $yGUI = GUICreate("", 200, 120, (@DesktopWidth/2)-100, (@DesktopHeight/2)-60, $WS_POPUP , $WS_EX_LAYERED + $WS_EX_TOOLWINDOW+$WS_EX_TOPMOST) _GDIPlus_Startup() $yImage = _GDIPlus_ImageLoadFromFile(@ScriptDir &"\Set\y.png") SetBitMap($yGUI , $yImage, 255) GUISetState(@SW_SHOW) EndFunc ;==>MynameNOW the PNGs, download this rar file attached put it in the script directory and bam u got itHAPPY VALENTINE againcredit goes to andybiochem first then me, i just created the GDI partEdit : spellingSet.rar Edited February 20, 2009 by yehia wakillon 1 My Scripts:IE New UDFsElastic images moving under mouse (with a happy valentine's example)_FileRemoveLine Link to comment Share on other sites More sharing options...
Andreik Posted February 13, 2009 Share Posted February 13, 2009 Very nice. How can I create a PNG like your PNG with your name to modify with Vantentine's Day. When the words fail... music speaks. Link to comment Share on other sites More sharing options...
JRowe Posted February 13, 2009 Share Posted February 13, 2009 Very cool. I like the effect, kudos to both you and Andybiochem. [center]However, like ninjas, cyber warriors operate in silence.AutoIt Chat Engine (+Chatbot) , Link Grammar for AutoIt , Simple Speech RecognitionArtificial Neural Networks UDF , Bayesian Networks UDF , Pattern Matching UDFTransparent PNG GUI Elements , Au3Irrlicht 2Advanced Mouse Events MonitorGrammar Database GeneratorTransitions & Tweening UDFPoker Hand Evaluator[/center] Link to comment Share on other sites More sharing options...
UEZ Posted February 13, 2009 Share Posted February 13, 2009 Very, very nice When you change line 36 to For $i = ($iDots - 1) To 1 Step -1 the hearts will be drawn from back to front.Thanks,UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
yehia Posted February 13, 2009 Author Share Posted February 13, 2009 thanks all i really lost the hope that someone will replay my topic btw o used PNGs cause u can use them layered for the shadow effects and u can used photoshop to create them @Andreik u can get a portable version like 50 mb or something @JRowe thanks man @UEZ and u have the vars u can change $iSegLen value and u will just get them away from each other My Scripts:IE New UDFsElastic images moving under mouse (with a happy valentine's example)_FileRemoveLine Link to comment Share on other sites More sharing options...
UEZ Posted February 13, 2009 Share Posted February 13, 2009 If you add HotKeySet("{ESC}", "_Close") you can exit by pressing ESC Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
yehia Posted February 13, 2009 Author Share Posted February 13, 2009 (edited) lol thats a part of the exit function that andybiochem had in his script xD will remove it btw in my main script i made for my GF i used it thats y u see it here but whats inside it is a bit gay something like what any girl would like to hear Edited February 13, 2009 by yehia My Scripts:IE New UDFsElastic images moving under mouse (with a happy valentine's example)_FileRemoveLine Link to comment Share on other sites More sharing options...
UEZ Posted February 13, 2009 Share Posted February 13, 2009 (edited) I don't like that f... day UEZ Edited February 13, 2009 by UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
yehia Posted February 15, 2009 Author Share Posted February 15, 2009 ok removed the useless part @UEZ it aint that bad with a GF My Scripts:IE New UDFsElastic images moving under mouse (with a happy valentine's example)_FileRemoveLine Link to comment Share on other sites More sharing options...
andybiochem Posted February 15, 2009 Share Posted February 15, 2009 HA! and everyone said this had no use! I feel happy in the fact I may have got you laid. Good job yehia. - Table UDF - create simple data tables - Line Graph UDF GDI+ - quickly create simple line graphs with x and y axes (uses GDI+ with double buffer) - Line Graph UDF - quickly create simple line graphs with x and y axes (uses AI native graphic control) - Barcode Generator Code 128 B C - Create the 1/0 code for barcodes. - WebCam as BarCode Reader - use your webcam to read barcodes - Stereograms!!! - make your own stereograms in AutoIT - Ziggurat Gaussian Distribution RNG - generate random numbers based on normal/gaussian distribution - Box-Muller Gaussian Distribution RNG - generate random numbers based on normal/gaussian distribution - Elastic Radio Buttons - faux-gravity effects in AutoIT (from javascript)- Morse Code Generator - Generate morse code by tapping your spacebar! Link to comment Share on other sites More sharing options...
UEZ Posted February 15, 2009 Share Posted February 15, 2009 ok removed the useless part@UEZ it aint that bad with a GF I don't want to discuss here the sense or nonsenses of Valentine's day even though I've a gf, be married or anything else. I just wanted to say my opinion about VD - probably it was off topic...UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
yehia Posted February 16, 2009 Author Share Posted February 16, 2009 HA! and everyone said this had no use! I feel happy in the fact I may have got you laid.Good job yehia.@andybiochem hahahaha well not laid xDI don't want to discuss here the sense or nonsenses of Valentine's day even though I've a gf, be married or anything else. I just wanted to say my opinion about VD - probably it was off topic...UEZ@UEZ okand please if anyone have any changes to apply on this to make it look better just show the codes and thanks all for your nice comments My Scripts:IE New UDFsElastic images moving under mouse (with a happy valentine's example)_FileRemoveLine Link to comment Share on other sites More sharing options...
yehia Posted February 19, 2009 Author Share Posted February 19, 2009 (edited) since i noticed that the above example just gives PNGs number - 1 so i created this to get the exact number of PNGs : expandcollapse popup;====== Elastic Trail script ====== ; Original Javascript by Philip Winston - pwinston@yahoo.com ; Adapted for AutoIT by AndyBiochem ; Used with GDI+ for PNG's by yehia #include <WindowsConstants.au3> #include <GuiConstantsEx.au3> #include <GDIPlus.au3> ;----- Variables ----- Global $iDots = 7;Number of BNGs Global $aDots[$iDots + 1][5] ;to get exact no of BNGs Global $iXpos = 0 Global $iYpos = 0 Global $iDeltaT = 0.01 Global $iSegLen = 10 Global $iSpringK = 10 Global $iMass = 1 Global $iXGravity = 0 Global $iYGravity = 50 Global $iRes = 10 Global $iStopVel = 0.1 Global $iStopAcc = 0.1 Global $iDotSize = 25 Global $iBounce = 0.75 Global Const $AC_SRC_ALPHA = 1 Global $iHeight = @DesktopHeight Global $iWidth = @DesktopWidth ;----- 'Dots' ----- For $i = 1 To $iDots ;to get exact no of dots $iDotSize-=2 $aDots[$i][0] = GUICreate("", $iDotSize, $iDotSize, 144, 160, $WS_POPUP , $WS_EX_LAYERED + $WS_EX_TOOLWINDOW+$WS_EX_TOPMOST) _GDIPlus_Startup() $hImage = _GDIPlus_ImageLoadFromFile(@ScriptDir &"\Set\" &$i& ".png");"\untitled.png") SetBitMap($aDots[$i][0] , $hImage, 255) GUISetState(@SW_SHOW) Next ;############### LOOP ############### While 1 Sleep(10) $m = MouseGetPos() $iXpos = $m[0] $iYpos = $m[1] _Animate() WEnd ;#################################### Func _Animate() $aDots[0][1] = $iXpos $aDots[0][2] = $iYpos For $i = 1 To $iDots ; to get exact number of dots Local $spring[3] $spring[1] = 0 $spring[2] = 0 _Spring_Force($i - 1, $i, $spring) If $i < ($iDots - 1) Then _Spring_Force($i + 1, $i, $spring) Local $resist[3] $resist[1] = -$aDots[$i][3] * $iRes $resist[2] = -$aDots[$i][4] * $iRes Local $accel[3] $accel[1] = ($spring[1] + $resist[1]) / $iMass + $iXGravity $accel[2] = ($spring[2] + $resist[2]) / $iMass + $iYGravity $aDots[$i][3] += ($iDeltaT * $accel[1]) $aDots[$i][4] += ($iDeltaT * $accel[2]) If Abs($aDots[$i][3]) < $iStopVel And Abs($aDots[$i][4]) < $iStopVel And Abs($accel[1]) < $iStopAcc And Abs($accel[2]) < $iStopAcc Then $aDots[$i][3] = 0 $aDots[$i][4] = 0 EndIf $aDots[$i][1] += $aDots[$i][3] $aDots[$i][2] += $aDots[$i][4] If ($aDots[$i][2] < 0) Then If ($aDots[$i][4] < 0) Then $aDots[$i][4] = $iBounce * - $aDots[$i][4] $aDots[$i][2] = 0 EndIf If ($aDots[$i][2] >= $iHeight - $iDotSize - 1) Then If ($aDots[$i][4] > 0) Then $aDots[$i][4] = $iBounce * - $aDots[$i][4] $aDots[$i][2] = $iHeight - $iDotSize - 1 EndIf If ($aDots[$i][1] >= $iWidth - $iDotSize) Then If ($aDots[$i][3] > 0) Then $aDots[$i][3] = $iBounce * - $aDots[$i][3] $aDots[$i][1] = $iWidth - $iDotSize - 1 EndIf If ($aDots[$i][1] < 0) Then If ($aDots[$i][3] < 0) Then $aDots[$i][3] = $iBounce * - $aDots[$i][3] $aDots[$i][1] = 0 EndIf $aDots[$i][1] = $aDots[$i][1] + .24*$i ;for centering PNGs under mouse WinMove($aDots[$i][0], "", $aDots[$i][1] , $aDots[$i][2]) Next EndFunc ;==>_Animate Func _Spring_Force($i, $j, ByRef $spring) Local $springF $dx = $aDots[$i][1] - $aDots[$j][1] $dy = $aDots[$i][2] - $aDots[$j][2] $len = Sqrt($dx ^ 2 + $dy ^ 2) If Not ($len > $iSegLen) Then Return $springF = $iSpringK * ($len - $iSegLen) $spring[1] += ($dx / $len) * $springF $spring[2] += ($dy / $len) * $springF EndFunc ;==>_Spring_Force 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 comment please thanks Edited February 24, 2009 by yehia My Scripts:IE New UDFsElastic images moving under mouse (with a happy valentine's example)_FileRemoveLine Link to comment Share on other sites More sharing options...
ukmazy Posted February 22, 2009 Share Posted February 22, 2009 wow what a nice effect you have here, too bad its late to give my GF that i tested the second script you provided too but didnt notice the difference until i did a count for the hearts good work man Link to comment Share on other sites More sharing options...
yehia Posted February 24, 2009 Author Share Posted February 24, 2009 thanks a lot that's supportive and btw its never too late and about the difference between the first and the second script; the first always misses the last BNG (the smallest one) thanks for your replay and thats the script to draw the BNGs from the end expandcollapse popup;====== Elastic Trail script ====== ; Original Javascript by Philip Winston - pwinston@yahoo.com ; Adapted for AutoIT by AndyBiochem ; Used with GDI+ for PNG's by yehia #include <WindowsConstants.au3> #include <GuiConstantsEx.au3> #include <GDIPlus.au3> ;----- Variables ----- Global $iDots = 7 ;..... Number of PNGs Global $aDots[$iDots][5] ;..... PNGs array Global $iXpos = 0 Global $iYpos = 0 Global $iDeltaT = 0.01 Global $iSegLen = 10 Global $iSpringK = 10 Global $iMass = 1 Global $iXGravity = 0 Global $iYGravity = 50 Global $iRes = 10 Global $iStopVel = 0.1 Global $iStopAcc = 0.1 Global $iDotSize = 25 Global $iBounce = 0.75 Global Const $AC_SRC_ALPHA = 1 Global $iHeight = @DesktopHeight Global $iWidth = @DesktopWidth ;----- 'PNGs' ----- Myname() ; just my name on the back :P For $i = ($iDots - 1) To 1 Step -1 $iDotSize-=2 $aDots[$i][0] = GUICreate("", $iDotSize, $iDotSize, 144, 160, $WS_POPUP , $WS_EX_LAYERED + $WS_EX_TOOLWINDOW+$WS_EX_TOPMOST) _GDIPlus_Startup() $hImage = _GDIPlus_ImageLoadFromFile(@ScriptDir &"\Set\" &$i& ".png") SetBitMap($aDots[$i][0] , $hImage, 255) GUISetState(@SW_SHOW) Next ;############### LOOP ############### While 1 Sleep(10) $m = MouseGetPos() $iXpos = $m[0] $iYpos = $m[1] _Animate() WEnd ;#################################### Func _Animate() $aDots[0][1] = $iXpos $aDots[0][2] = $iYpos For $i = 1 To ($iDots - 1) Local $spring[3] $spring[1] = 0 $spring[2] = 0 _Spring_Force($i - 1, $i, $spring) If $i < ($iDots - 1) Then _Spring_Force($i + 1, $i, $spring) Local $resist[3] $resist[1] = -$aDots[$i][3] * $iRes $resist[2] = -$aDots[$i][4] * $iRes Local $accel[3] $accel[1] = ($spring[1] + $resist[1]) / $iMass + $iXGravity $accel[2] = ($spring[2] + $resist[2]) / $iMass + $iYGravity $aDots[$i][3] += ($iDeltaT * $accel[1]) $aDots[$i][4] += ($iDeltaT * $accel[2]) If Abs($aDots[$i][3]) < $iStopVel And Abs($aDots[$i][4]) < $iStopVel And Abs($accel[1]) < $iStopAcc And Abs($accel[2]) < $iStopAcc Then $aDots[$i][3] = 0 $aDots[$i][4] = 0 EndIf $aDots[$i][1] += $aDots[$i][3] $aDots[$i][2] += $aDots[$i][4] If ($aDots[$i][2] < 0) Then If ($aDots[$i][4] < 0) Then $aDots[$i][4] = $iBounce * - $aDots[$i][4] $aDots[$i][2] = 0 EndIf If ($aDots[$i][2] >= $iHeight - $iDotSize - 1) Then If ($aDots[$i][4] > 0) Then $aDots[$i][4] = $iBounce * - $aDots[$i][4] $aDots[$i][2] = $iHeight - $iDotSize - 1 EndIf If ($aDots[$i][1] >= $iWidth - $iDotSize) Then If ($aDots[$i][3] > 0) Then $aDots[$i][3] = $iBounce * - $aDots[$i][3] $aDots[$i][1] = $iWidth - $iDotSize - 1 EndIf If ($aDots[$i][1] < 0) Then If ($aDots[$i][3] < 0) Then $aDots[$i][3] = $iBounce * - $aDots[$i][3] $aDots[$i][1] = 0 EndIf WinMove($aDots[$i][0], "", $aDots[$i][1], $aDots[$i][2]) Next EndFunc ;==>_Animate Func _Spring_Force($i, $j, ByRef $spring) Local $springF $dx = $aDots[$i][1] - $aDots[$j][1] $dy = $aDots[$i][2] - $aDots[$j][2] $len = Sqrt($dx ^ 2 + $dy ^ 2) If Not ($len > $iSegLen) Then Return $springF = $iSpringK * ($len - $iSegLen) $spring[1] += ($dx / $len) * $springF $spring[2] += ($dy / $len) * $springF EndFunc ;==>_Spring_Force Func _Close() Exit EndFunc ;==>_Close 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 ;==>SetBitmap Func Myname() $yGUI = GUICreate("", 200, 120, (@DesktopWidth/2)-100, (@DesktopHeight/2)-60, $WS_POPUP , $WS_EX_LAYERED + $WS_EX_TOOLWINDOW+$WS_EX_TOPMOST) _GDIPlus_Startup() $yImage = _GDIPlus_ImageLoadFromFile(@ScriptDir &"\Set\y.png") SetBitMap($yGUI , $yImage, 255) GUISetState(@SW_SHOW) EndFunc My Scripts:IE New UDFsElastic images moving under mouse (with a happy valentine's example)_FileRemoveLine Link to comment Share on other sites More sharing options...
Yashied Posted April 5, 2009 Share Posted April 5, 2009 Beautiful! My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
yehia Posted April 7, 2009 Author Share Posted April 7, 2009 thanks a lot im just thinking what more can this example do ... something like a mouse key chain My Scripts:IE New UDFsElastic images moving under mouse (with a happy valentine's example)_FileRemoveLine Link to comment Share on other sites More sharing options...
trancexx Posted April 8, 2009 Share Posted April 8, 2009 thanks a lot im just thinking what more can this example do ...something like a mouse key chain Easter Bunnies hanging/shagging arround would be... something. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
yehia Posted April 12, 2009 Author Share Posted April 12, 2009 hahaha thanks for the hint My Scripts:IE New UDFsElastic images moving under mouse (with a happy valentine's example)_FileRemoveLine Link to comment Share on other sites More sharing options...
mesale0077 Posted April 12, 2009 Share Posted April 12, 2009 very nice.. Link to comment Share on other sites More sharing options...
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