Pastebin
API
tools
faq
paste
Login
Sign up
Please fix the following errors:
New Paste
Syntax Highlighting
#include <WindowsConstants.au3> #include <GUIConstants.au3> #include <GDIPlus.au3> #include <WinAPI.au3> #include <Date.au3> ; -Authors: name22 (www.autoit.de), Andy (www.autoit.de), Facemix (www.autoit.de) Opt("GUIOnEventMode", 1) Global Const $nTau = ACos(-1) * 2 Global $vNTdll = DllOpen("ntdll.dll") Global $tPrecSleep = DllStructCreate("int64 time;") Global $pPrecSleep = DllStructGetPtr($tPrecSleep) ;###-v-SETTINGS-v-### Global $iWidth = 600 Global $iHeight = 300 Global $nFPS = 60 Global $nStepSpeed = 1 Global $iARGB_BG = 0xFF505050 Global $iARGB_Snow = 0xFFFFFFFF Global $iARGB_TextFill = 0xFF0000FF Global $iARGB_TextFill2 = 0xFFFF0000 Global $iARGB_TextFill3 = 0xFF0000FF Global $iARGB_TextFill4 = 0xFF353535 Global $iARGB_TextBorder = 0xFFA00000 Global $iFlakeCount = 60 Global $iMinFallingSpeed = 20, $iMaxFallingSpeed = 50 Global $iMinOscillations = 2, $iMaxOscillations = 5 Global $iMinOscillationDist = 10, $iMaxOscillationDist = 50 Global $iMinRadius = 1, $iMaxRadius = 3 Global $iBlastRadius = 200 Global $iBlastAccell = 300 Global $nAirFriction = 0.95 ;###-^-SETTINGS-^-### Global $aFlakes[$iFlakeCount + 1][8] = [[$iFlakeCount]] Global $hWnd, $hDC_Window, $hDC_Bitmap, $hBitmap, $hGraphics, $hOldObj, $hBrush_Snow, $hBrush_TextFill, $hPen_Border Global $hMatrix, $tLayout, $hFormat, $hFamily, $hPath, $nScale, $nStep = 0, $iH, $iM, $iS, $iD, $sText, $sTextOld Global $nSleepTime = 1000 / $nFPS For $i = 1 To $aFlakes[0][0] $aFlakes[$i][0] = Random(10, $iWidth - 10, 1) $aFlakes[$i][1] = Random(-$iHeight, 0, 1) $aFlakes[$i][2] = 0 $aFlakes[$i][3] = 0 $aFlakes[$i][4] = Random($iMinRadius, $iMaxRadius, 1) $aFlakes[$i][5] = Random($iMinFallingSpeed, $iMaxFallingSpeed) $aFlakes[$i][6] = Random($iMinOscillations, $iMaxOscillations, 1) $aFlakes[$i][7] = Random($iMinOscillationDist, $iMaxOscillationDist) * (-1) ^ Random(1, 2, 1) Next $hWnd = GUICreate("name22 - Snowflakes", $iWidth, $iHeight) GUISetState() $hDC_Window = _WinAPI_GetDC($hWnd) $hDC_Bitmap = _WinAPI_CreateCompatibleDC($hDC_Window) $hBitmap = _WinAPI_CreateCompatibleBitmap($hDC_Window, $iWidth, $iHeight) $hOldObj = _WinAPI_SelectObject($hDC_Bitmap, $hBitmap) _GDIPlus_Startup() $hGraphics = _GDIPlus_GraphicsCreateFromHDC($hDC_Bitmap) _GDIPlus_GraphicsSetClipRect($hGraphics, 0, 0, $iWidth, $iHeight) _GDIPlus_GraphicsSetSmoothingMode($hGraphics, 2) $hBrush_Snow = _GDIPlus_BrushCreateSolid($iARGB_Snow) $hBrush_TextFill = _GDIPlus_BrushCreateSolid($iARGB_TextFill) $hPen_Border = _GDIPlus_PenCreate($iARGB_TextBorder, 3) DllCall($ghGDIPDll, "uint", "GdipSetPenLineJoin", "hwnd", $hPen_Border, "int", 2) $hMatrix = _GDIPlus_MatrixCreate() $tLayout = _GDIPlus_RectFCreate(0, 0, 0, 0) $hFormat = _GDIPlus_StringFormatCreate() $hFamily = _GDIPlus_FontFamilyCreate("Arial") $hPath = _CreatePath("88 - 88:88:88") _GDIPlus_GraphicsClear($hGraphics, $iARGB_BG) _Redraw() OnAutoItExitRegister("_Shutdown") GUIRegisterMsg($WM_PAINT, "_Redraw") GUISetOnEvent($GUI_EVENT_CLOSE, "_Close") GUISetOnEvent($GUI_EVENT_PRIMARYDOWN, "_Click") AdlibRegister("_UpdateTime", 100) $nT_Sleep = TimerInit() + $nSleepTime While True DllStructSetData($tPrecSleep, "time", -10000 * ($nSleepTime - TimerDiff($nT_Sleep))) DllCall($vNTdll, "dword", "ZwDelayExecution", "int", 0, "ptr", $pPrecSleep) $nFrameTime = TimerDiff($nT_Sleep) $nT_Sleep = TimerInit() $nFPS_Cur = 1000 / $nFrameTime $nStep += $nStepSpeed / $nFPS_Cur $nScale = Abs(Sin($nStep)) _GDIPlus_GraphicsClear($hGraphics, $iARGB_BG) DllCall($ghGDIPDll, "uint", "GdipTranslateWorldTransform", "hwnd", $hGraphics, "float", -$iWidth / 2, "float", -$iHeight / 2, "int", False) DllCall($ghGDIPDll, "uint", "GdipScaleWorldTransform", "hwnd", $hGraphics, "float", $nScale, "float", $nScale, "int", True) DllCall($ghGDIPDll, "uint", "GdipTranslateWorldTransform", "hwnd", $hGraphics, "float", $iWidth / 2, "float", $iHeight / 2, "int", True) DllCall($ghGDIPDll, "uint", "GdipDrawPath", "hwnd", $hGraphics, "hwnd", $hPen_Border, "hwnd", $hPath) DllCall($ghGDIPDll, "uint", "GdipFillPath", "hwnd", $hGraphics, "hwnd", $hBrush_TextFill, "hwnd", $hPath) DllCall($ghGDIPDll, "uint", "GdipResetWorldTransform", "hwnd", $hGraphics) For $i = 1 To $aFlakes[0][0] $aFlakes[$i][1] += ($aFlakes[$i][5] + $aFlakes[$i][3]) / $nFPS_Cur $aFlakes[$i][0] += (Sin($aFlakes[$i][1] / $iHeight * $nTau * $aFlakes[$i][6]) * $aFlakes[$i][7] + $aFlakes[$i][2]) / $nFPS_Cur $aFlakes[$i][2] *= $nAirFriction $aFlakes[$i][3] *= $nAirFriction If $aFlakes[$i][1] > $iHeight Or $aFlakes[$i][0] < -20 Or $aFlakes[$i][0] > $iWidth + 20 Then $aFlakes[$i][0] = Random(10, $iWidth - 10, 1) $aFlakes[$i][1] = Random(-$iHeight, 0, 1) $aFlakes[$i][2] = 0 $aFlakes[$i][3] = 0 $aFlakes[$i][4] = Random($iMinRadius, $iMaxRadius, 1) $aFlakes[$i][5] = Random($iMinFallingSpeed, $iMaxFallingSpeed) $aFlakes[$i][6] = Random($iMinOscillations, $iMaxOscillations, 1) $aFlakes[$i][7] = Random($iMinOscillationDist, $iMaxOscillationDist) EndIf _GDIPlus_GraphicsFillEllipse($hGraphics, $aFlakes[$i][0] - $aFlakes[$i][4] / 2, $aFlakes[$i][1] - $aFlakes[$i][4] / 2, $aFlakes[$i][4] * 2, $aFlakes[$i][4] * 2, $hBrush_Snow) Next _WinAPI_BitBlt($hDC_Window, 0, 0, $iWidth, $iHeight, $hDC_Bitmap, 0, 0, $SRCCOPY) WEnd Func _UpdateTime() _TicksToTime(_DateDiff('s', _NowCalc(), "2013/01/01 00:00:00") * 1000, $iH, $iM, $iS) If $iH > 23 Then $iD = StringFormat("%02i", $iH / 24); volle Tage $iH = $iH - ($iD * 24); volle Tage abziehen Else $iD = 0 EndIf If $sText = "00 - 00:00:00" Then AdlibUnRegister("_UpdateTime") Feuerwerk() ; Funktion Feuerwerk soll dann ausgeführt werden Else $sText = StringFormat("%02i - %02i:%02i:%02i", $iD, $iH, $iM, $iS) EndIf If $sText <> $sTextOld Then $sTextOld = $sText DllCall($ghGDIPDll, "uint", "GdipResetPath", "hwnd", $hPath) DllCall($ghGDIPDll, "uint", "GdipAddPathString", "hwnd", $hPath, "wstr", $sText, "int", -1, "hwnd", $hFamily, "int", 1, "float", 100, "ptr", DllStructGetPtr($tLayout), "hwnd", $hFormat) DllCall($ghGDIPDll, "uint", "GdipTransformPath", "hwnd", $hPath, "hwnd", $hMatrix) EndIf EndFunc Func _Click() Local $tMousePos = _WinAPI_GetMousePos(True, $hWnd) For $i = 1 To $aFlakes[0][0] $iX_Dist = ($aFlakes[$i][0] - $aFlakes[$i][4]) - DllStructGetData($tMousePos, "X") $iY_Dist = ($aFlakes[$i][1] - $aFlakes[$i][4]) - DllStructGetData($tMousePos, "Y") $iDist = Sqrt($iX_Dist ^ 2 + $iY_Dist ^ 2) If $iDist = 0 Then ContinueLoop If $iDist < $iBlastRadius Then $aFlakes[$i][2] = (1 - $iDist / $iBlastRadius) * ($iX_Dist / $iDist) * $iBlastAccell $aFlakes[$i][3] = (1 - $iDist / $iBlastRadius) * ($iY_Dist / $iDist) * $iBlastAccell EndIf Next EndFunc ;==>_Click Func _Redraw() _WinAPI_BitBlt($hDC_Window, 0, 0, $iWidth, $iHeight, $hDC_Bitmap, 0, 0, $SRCCOPY) EndFunc ;==>_Redraw Func _Close() Exit EndFunc ;==>_Close Func _Shutdown() _WinAPI_SelectObject($hDC_Bitmap, $hOldObj) _WinAPI_ReleaseDC($hWnd, $hDC_Window) _WinAPI_DeleteDC($hDC_Bitmap) _WinAPI_DeleteObject($hBitmap) _GDIPlus_GraphicsDispose($hGraphics) _GDIPlus_BrushDispose($hBrush_Snow) _GDIPlus_PenDispose($hPen_Border) _GDIPlus_MatrixDispose($hMatrix) _GDIPlus_StringFormatDispose($hFormat) _GDIPlus_FontFamilyDispose($hFamily) DllCall($ghGDIPDll, "uint", "GdipDeletePath", "hwnd", $hPath) _GDIPlus_Shutdown() DllClose($vNTdll) EndFunc ;==>_Shutdown Func _CreatePath($sText) Local $tBounds = _GDIPlus_RectFCreate(0, 0, 0, 0) Local $aResult = DllCall($ghGDIPDll, "uint", "GdipCreatePath", "int", 0, "int*", 0) If @error Or Not IsArray($aResult) Then Return SetError(1, 1, False) Local $hPath = $aResult[2] DllCall($ghGDIPDll, "uint", "GdipAddPathString", "hwnd", $hPath, "wstr", $sText, "int", -1, "hwnd", $hFamily, "int", 1, "float", 100, "ptr", DllStructGetPtr($tLayout), "hwnd", $hFormat) DllCall($ghGDIPDll, "uint", "GdipGetPathWorldBounds", "hwnd", $hPath, "ptr", DllStructGetPtr($tBounds), "hwnd", 0, "hwnd", 0) _GDIPlus_MatrixTranslate($hMatrix, -DllStructGetData($tBounds, "X"), -DllStructGetData($tBounds, "Y")) _GDIPlus_MatrixScale($hMatrix, $iWidth / DllStructGetData($tBounds, "Width"), $iHeight / DllStructGetData($tBounds, "Height"), True) DllCall($ghGDIPDll, "uint", "GdipTransformPath", "hwnd", $hPath, "hwnd", $hMatrix) Return $hPath EndFunc ;==>_CreatePath Func Feuerwerk() Local $aDraw Local $iCount = 10, $iExplosion = 100, $iExplosionGround = 1, $iRadius = 600, $iBack = 0x09000000, $iSleep = 5 Global $iWidth2 = @DesktopWidth, $iHeight2 = @DesktopHeight, $aStart[$iCount][4] = [[Random(0, $iWidth2, 0), Random(0, $iHeight2, 0), 0, _GDIPlus_PenCreate(Random(0xFF000000, 0xFFFFFFFF, 0))],[Random(0, $iWidth2, 0), Random(0, $iHeight2, 0), 0, _GDIPlus_PenCreate(Random(0xFF000000, 0xFFFFFFFF, 0))]], $iSleeping = 0 For $i = 0 To UBound($aStart) - 1 $aStart[$i][0] = Random(0, $iWidth2, 0) $aStart[$i][1] = Random(0, $iHeight2, 0) $aStart[$i][2] = $iExplosion $aStart[$i][3] = _GDIPlus_PenCreate(Random(0xFF000000, 0xFFFFFFFF, 0)) Next While True _GDIPlus_GraphicsClear($hGraphics, $iBack) If $iSleeping = 0 Then For $j = 0 To UBound($aStart) - 1 For $i = 0 To 35 $aDraw = Dreieck($i * 10, $aStart[$j][2] - $iExplosion) _GDIPlus_GraphicsDrawRect($hGraphics, $aStart[$j][0] + Round($aDraw[0], 0), $aStart[$j][1] + Round($aDraw[1], 0), 2, 2, $aStart[$j][3]) Next $aStart[$j][2] += $iExplosionGround + Ceiling(10 * $iExplosion / ($aStart[$j][2])) If $aStart[$j][2] > $iRadius Then $iSleeping = $iSleep $aStart[$j][0] = Random(0, $iWidth2, 0) $aStart[$j][1] = Random(0, $iHeight2, 0) $aStart[$j][2] = $iExplosion _GDIPlus_PenDispose($aStart[$j][3]) $aStart[$j][3] = _GDIPlus_PenCreate(Random(0xFF000000, 0xFFFFFFFF, 0)) EndIf Next Else $iSleeping -= 1 EndIf _WinAPI_RedrawWindow($hWnd, 0, 0, 2) WEnd EndFunc ;==>Feuerwerk Func Dreieck($iWinkel, $iLaenge) Local $iDeg = 0.0174532925199433, $aRet[2] $aRet[0] = Sin($iWinkel * $iDeg) * $iLaenge $aRet[1] = Cos($iWinkel * $iDeg) * $iLaenge Return $aRet EndFunc ;==>Dreieck ; #FUNCTION# ==================================================================================================================== ; Name...........: _GDIPlus_GraphicsSetClipRect ; Description ...: Updates the clipping region of a Graphics object to a region that is the combination of itself and a rectangle ; Syntax.........: _GDIPlus_GraphicsSetClipRect($hGraphics, $nX, $nY, $nWidth, $nHeight[, $iCombineMode = 0]) ; Parameters ....: $hGraphics - Pointer to a Graphics object ; $nX - X coordinate of the upper-left corner of the rectangle ; $nY - Y coordinate of the upper-left corner of the rectangle ; $nWidth - Width of the rectangle ; $nHeight - Height of the rectangle ; $iCombineMode - Regions combination mode: ; |0 - The existing region is replaced by the new region ; |1 - The existing region is replaced by the intersection of itself and the new region ; |2 - The existing region is replaced by the union of itself and the new region ; |3 - The existing region is replaced by the result of performing an XOR on the two regions ; |4 - The existing region is replaced by the portion of itself that is outside of the new region ; |5 - The existing region is replaced by the portion of the new region that is outside of the existing region ; Return values .: Success - True ; Failure - False and either: ; |@error and @extended are set if DllCall failed ; |$GDIP_STATUS contains a non zero value specifying the error code ; Remarks .......: None ; Related .......: None ; Link ..........; @@MsdnLink@@ GdipSetClipRect ; Example .......; No ; =============================================================================================================================== Func _GDIPlus_GraphicsSetClipRect($hGraphics, $nX, $nY, $nWidth, $nHeight, $iCombineMode = 0) Local $aResult = DllCall($ghGDIPDll, "uint", "GdipSetClipRect", "hwnd", $hGraphics, "float", $nX, "float", $nY, "float", $nWidth, "float", $nHeight, "int", $iCombineMode) If @error Then Return SetError(@error, @extended, False) $GDIP_STATUS = $aResult[0] Return $aResult[0] = 0 EndFunc ;==>_GDIPlus_GraphicsSetClipRect
Optional Paste Settings
Syntax Highlighting:
None
Bash
C
C#
C++
CSS
HTML
JSON
Java
JavaScript
Lua
Markdown (PRO members only)
Objective C
PHP
Perl
Python
Ruby
Swift
4CS
6502 ACME Cross Assembler
6502 Kick Assembler
6502 TASM/64TASS
ABAP
AIMMS
ALGOL 68
APT Sources
ARM
ASM (NASM)
ASP
ActionScript
ActionScript 3
Ada
Apache Log
AppleScript
Arduino
Asymptote
AutoIt
Autohotkey
Avisynth
Awk
BASCOM AVR
BNF
BOO
Bash
Basic4GL
Batch
BibTeX
Blitz Basic
Blitz3D
BlitzMax
BrainFuck
C
C (WinAPI)
C Intermediate Language
C for Macs
C#
C++
C++ (WinAPI)
C++ (with Qt extensions)
C: Loadrunner
CAD DCL
CAD Lisp
CFDG
CMake
COBOL
CSS
Ceylon
ChaiScript
Chapel
Clojure
Clone C
Clone C++
CoffeeScript
ColdFusion
Cuesheet
D
DCL
DCPU-16
DCS
DIV
DOT
Dart
Delphi
Delphi Prism (Oxygene)
Diff
E
ECMAScript
EPC
Easytrieve
Eiffel
Email
Erlang
Euphoria
F#
FO Language
Falcon
Filemaker
Formula One
Fortran
FreeBasic
FreeSWITCH
GAMBAS
GDB
GDScript
Game Maker
Genero
Genie
GetText
Go
Godot GLSL
Groovy
GwBasic
HQ9 Plus
HTML
HTML 5
Haskell
Haxe
HicEst
IDL
INI file
INTERCAL
IO
ISPF Panel Definition
Icon
Inno Script
J
JCL
JSON
Java
Java 5
JavaScript
Julia
KSP (Kontakt Script)
KiXtart
Kotlin
LDIF
LLVM
LOL Code
LScript
Latex
Liberty BASIC
Linden Scripting
Lisp
Loco Basic
Logtalk
Lotus Formulas
Lotus Script
Lua
M68000 Assembler
MIX Assembler
MK-61/52
MPASM
MXML
MagikSF
Make
MapBasic
Markdown (PRO members only)
MatLab
Mercury
MetaPost
Modula 2
Modula 3
Motorola 68000 HiSoft Dev
MySQL
Nagios
NetRexx
Nginx
Nim
NullSoft Installer
OCaml
OCaml Brief
Oberon 2
Objeck Programming Langua
Objective C
Octave
Open Object Rexx
OpenBSD PACKET FILTER
OpenGL Shading
Openoffice BASIC
Oracle 11
Oracle 8
Oz
PARI/GP
PCRE
PHP
PHP Brief
PL/I
PL/SQL
POV-Ray
ParaSail
Pascal
Pawn
Per
Perl
Perl 6
Phix
Pic 16
Pike
Pixel Bender
PostScript
PostgreSQL
PowerBuilder
PowerShell
ProFTPd
Progress
Prolog
Properties
ProvideX
Puppet
PureBasic
PyCon
Python
Python for S60
QBasic
QML
R
RBScript
REBOL
REG
RPM Spec
Racket
Rails
Rexx
Robots
Roff Manpage
Ruby
Ruby Gnuplot
Rust
SAS
SCL
SPARK
SPARQL
SQF
SQL
SSH Config
Scala
Scheme
Scilab
SdlBasic
Smalltalk
Smarty
StandardML
StoneScript
SuperCollider
Swift
SystemVerilog
T-SQL
TCL
TeXgraph
Tera Term
TypeScript
TypoScript
UPC
Unicon
UnrealScript
Urbi
VB.NET
VBScript
VHDL
VIM
Vala
Vedit
VeriLog
Visual Pro Log
VisualBasic
VisualFoxPro
WHOIS
WhiteSpace
Winbatch
XBasic
XML
XPP
Xojo
Xorg Config
YAML
YARA
Z80 Assembler
ZXBasic
autoconf
jQuery
mIRC
newLISP
q/kdb+
thinBasic
Paste Expiration:
Never
Burn after read
10 Minutes
1 Hour
1 Day
1 Week
2 Weeks
1 Month
6 Months
1 Year
Paste Exposure:
Public
Unlisted
Private
Folder:
(members only)
Password
NEW
Enabled
Disabled
Burn after read
NEW
Paste Name / Title:
Create New Paste
Hello
Guest
Sign Up
or
Login
Sign in with Facebook
Sign in with Twitter
Sign in with Google
You are currently not logged in, this means you can not edit or delete anything you paste.
Sign Up
or
Login
Public Pastes
Script: riordinare...
Batch | 6 min ago
df -h
Bash | 29 min ago
Script S17
Lua | 38 min ago
bank.py
Python | 1 hour ago
My Log File
HTML 5 | 1 hour ago
application.yml
C# | 2 hours ago
HelperBot
Lua | 2 hours ago
Untitled
Bash | 3 hours ago
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the
Cookies Policy
.
OK, I Understand
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!