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 <Misc.au3> ; - Author: name22 (www.autoit.de) ; Warning! This script needs a specific image to function (or you could make your own image of a frame and adjust the coordinates in _DrawBG). Press F10 to display the window. Opt("GUIOnEventMode", 1) Global Const $nPiHalf = ACos(-1) / 2 Global $vU32dll = DllOpen("user32.dll") ;###-v-SETTINGS-v-### $iGUIWidth = 600 ;Width of the GUI $iGUIHeight = 200 ;Height of the GUI $iDurationON = 600 ;The time it will take for the window to appear[in ms] $iDurationOFF = 400 ;The time it will take for the window to disappear [in ms] ;###-^-SETTINGS-^-### $tSize = DllStructCreate($tagSIZE) $pSize = DllStructGetPtr($tSize) DllStructSetData($tSize, "X", $iGUIWidth) DllStructSetData($tSize, "Y", $iGUIHeight) $tDest = DllStructCreate($tagSIZE) $pDest = DllStructGetPtr($tDest) DllStructSetData($tDest, "X", 0) DllStructSetData($tDest, "Y", 0) $tSource = DllStructCreate($tagPOINT) $pSource = DllStructGetPtr($tSource) $tBlend = DllStructCreate($tagBLENDFUNCTION) $pBlend = DllStructGetPtr($tBlend) DllStructSetData($tBlend, "Alpha", 0) DllStructSetData($tBlend, "Format", 1) $hMain = GUICreate("Example by name22", $iGUIWidth, $iGUIHeight, Default, Default, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_TOOLWINDOW)) GUISetState() $hDC_Main = _WinAPI_GetDC($hMain) $hDC_Buffer = _WinAPI_CreateCompatibleDC($hDC_Main) $hBitmap_Buffer = _WinAPI_CreateCompatibleBitmap($hDC_Main, $iGUIWidth, $iGUIHeight) _WinAPI_SelectObject($hDC_Buffer, $hBitmap_Buffer) _GDIPlus_Startup() $hGraphics = _GDIPlus_GraphicsCreateFromHDC($hDC_Buffer) _GDIPlus_GraphicsSetSmoothingMode($hGraphics, 2) $hBrush = _GDIPlus_BrushCreateSolid(0xFFFFFFFF) $hImage_BG = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\bg.png") $aBG_Glass = _CutImage($hImage_BG) GUIRegisterMsg($WM_PAINT, "_RedrawGUI") GUISetOnEvent($GUI_EVENT_CLOSE, "_Close", $hMain) OnAutoItExitRegister("_Shutdown") HotKeySet("{F10}", "_Show") While Sleep(1000) WEnd Func _Show() HotKeySet("{F10}") Local $iTimeOffset = 0, $iTime, $vTimer = TimerInit() GUISetState(@SW_SHOW, $hMain) While _IsPressed("79", $vU32dll) $iTime = Floor(TimerDiff($vTimer)) If $iTime < $iDurationON Then $nFrac = Sin($iTime / $iDurationON * $nPiHalf) $iWidthTmp = $nFrac * $iGUIWidth $iHeightTmp = $nFrac * $iGUIHeight $iAlphaTmp = Floor($nFrac * 0xFF) _GUISettings($iWidthTmp, $iHeightTmp, @DesktopWidth / 2 - $iWidthTmp / 2, @DesktopHeight / 2 - $iHeightTmp / 2, $iAlphaTmp) EndIf Sleep(10) WEnd HotKeySet("{F10}", "_Show") If $iTime <= $iDurationON Then $iTimeOffset = $iDurationOFF - $iTime / $iDurationON * $iDurationOFF EndIf $iTime = 0 $vTimer = TimerInit() While $iTime <= $iDurationOFF $iTime = Floor(TimerDiff($vTimer)) + $iTimeOffset $nFrac = Sin((1 - $iTime / $iDurationOFF) * $nPiHalf) $iWidthTmp = $nFrac * $iGUIWidth $iHeightTmp = $nFrac * $iGUIHeight $iAlphaTmp = Floor($nFrac * 0xFF) _GUISettings($iWidthTmp, $iHeightTmp, @DesktopWidth / 2 - $iWidthTmp / 2, @DesktopHeight / 2 - $iHeightTmp / 2, $iAlphaTmp) Sleep(10) WEnd _GUISettings(0, 0, 0, 0, 0) GUISetState(@SW_HIDE, $hMain) EndFunc Func _GUISettings($iWidth, $iHeight, $iX = -1, $iY = -1, $iAlpha = 255) DllStructSetData($tBlend, "Alpha", $iAlpha) DllStructSetData($tSize, "X", $iWidth) DllStructSetData($tSize, "Y", $iHeight) _WinAPI_DeleteObject($hBitmap_Buffer) _GDIPlus_GraphicsDispose($hGraphics) $hBitmap_Buffer = _WinAPI_CreateCompatibleBitmap($hDC_Main, $iWidth, $iHeight) _WinAPI_SelectObject($hDC_Buffer, $hBitmap_Buffer) $hGraphics = _GDIPlus_GraphicsCreateFromHDC($hDC_Buffer) _GDIPlus_GraphicsSetSmoothingMode($hGraphics, 2) _GDIPlus_GraphicsClear($hGraphics, 0) _DrawBG($aBG_Glass, $iWidth, $iHeight) If $iX = -1 And $iY = -1 Then _RedrawGUI() Else DllStructSetData($tDest, "X", Floor($iX)) DllStructSetData($tDest, "Y", Floor($iY)) _WinAPI_UpdateLayeredWindow($hMain, $hDC_Main, $pDest, $pSize, $hDC_Buffer, $pSource, 0, $pBlend, $ULW_ALPHA) EndIf EndFunc Func _DrawBG($aBG, $iWidth, $iHeight) _GDIPlus_GraphicsSetSmoothingMode($hGraphics, 0) _GDIPlus_GraphicsSetInterpolationMode($hGraphics, 5) _GDIPlus_GraphicsSetPixelOffsetMode($hGraphics, 2) _GDIPlus_GraphicsDrawImageRect($hGraphics, $aBG[0], 0, 0, 20, 20) ;upper left corner _GDIPlus_GraphicsDrawImageRect($hGraphics, $aBG[1], 0, $iHeight - 17, 20, 17) ;lower left corner _GDIPlus_GraphicsDrawImageRect($hGraphics, $aBG[2], $iWidth - 21, 0, 21, 20) ;upper right corner _GDIPlus_GraphicsDrawImageRect($hGraphics, $aBG[3], $iWidth - 21, $iHeight - 17, 21, 17) ;lower right corner _GDIPlus_GraphicsDrawImageRect($hGraphics, $aBG[4], 0, 20, 20, $iHeight - 37) ;left edge _GDIPlus_GraphicsDrawImageRect($hGraphics, $aBG[5], $iWidth - 21, 20, 21, $iHeight - 37) ;right edge _GDIPlus_GraphicsDrawImageRect($hGraphics, $aBG[6], 20, 0, $iWidth - 41, 20) ;upper edge _GDIPlus_GraphicsDrawImageRect($hGraphics, $aBG[7], 20, $iHeight - 17, $iWidth - 41, 17) ;lower edge _GDIPlus_GraphicsDrawImageRect($hGraphics, $aBG[8], 20, 20, $iWidth - 41, $iHeight - 37) ;center _GDIPlus_GraphicsSetSmoothingMode($hGraphics, 2) EndFunc Func _CutImage($hImage) ;Splits the image into 9 parts that can be individually scaled (prevents quality loss). Local $aReturn[9] $aReturn[0] = _GDIPlus_BitmapCloneArea($hImage, 0, 0, 20, 20, $GDIP_PXF32ARGB) ;upper left corner $aReturn[1] = _GDIPlus_BitmapCloneArea($hImage, 0, 87, 20, 17, $GDIP_PXF32ARGB) ;lower left corner $aReturn[2] = _GDIPlus_BitmapCloneArea($hImage, 86, 0, 21, 20, $GDIP_PXF32ARGB) ;upper right corner $aReturn[3] = _GDIPlus_BitmapCloneArea($hImage, 86, 87, 21, 17, $GDIP_PXF32ARGB) ;lower right corner $aReturn[4] = _GDIPlus_BitmapCloneArea($hImage, 0, 20, 20, 67, $GDIP_PXF32ARGB) ;left edge $aReturn[5] = _GDIPlus_BitmapCloneArea($hImage, 86, 20, 21, 67, $GDIP_PXF32ARGB) ;right edge $aReturn[6] = _GDIPlus_BitmapCloneArea($hImage, 20, 0, 66, 20, $GDIP_PXF32ARGB) ;upper edge $aReturn[7] = _GDIPlus_BitmapCloneArea($hImage, 20, 87, 66, 17, $GDIP_PXF32ARGB) ;lower edge $aReturn[8] = _GDIPlus_BitmapCloneArea($hImage, 20, 20, 66, 67, $GDIP_PXF32ARGB) ;center Return $aReturn EndFunc Func _RedrawGUI() _WinAPI_UpdateLayeredWindow($hMain, $hDC_Main, 0, $pSize, $hDC_Buffer, $pSource, 0, $pBlend, $ULW_ALPHA) EndFunc Func _Close() Exit EndFunc ;==>_Close Func _Shutdown() _WinAPI_ReleaseDC($hMain, $hDC_Main) _WinAPI_DeleteDC($hDC_Buffer) _WinAPI_DeleteObject($hBitmap_Buffer) _GDIPlus_GraphicsDispose($hGraphics) _GDIPlus_ImageDispose($hImage_BG) For $i = 0 To 8 _GDIPlus_BitmapDispose($aBG_Glass[$i]) Next _GDIPlus_BrushDispose($hBrush) _GDIPlus_Shutdown() EndFunc ;==>_Shutdown ; #FUNCTION# ==================================================================================================================== ; Name...........: _GDIPlus_GraphicsSetPixelOffsetMode ; Description ...: Sets the pixel offset mode of a Graphics object ; Syntax.........: _GDIPlus_GraphicsSetPixelOffsetMode($hGraphics, $iPixelOffsetMode) ; Parameters ....: $hGraphics - Pointer to a Graphics object ; $iPixelOffsetMode - Pixel offset mode: ; |0,1,3 - Pixel centers have integer coordinates ; |2,4 - Pixel centers have coordinates that are half way between integer values (i.e. 0.5, 20, 105.5, etc...) ; 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 .......: _GDIPlus_GraphicsGetPixelOffsetMode ; Link ..........; @@MsdnLink@@ GdipSetPixelOffsetMode ; Example .......; No ; =============================================================================================================================== Func _GDIPlus_GraphicsSetPixelOffsetMode($hGraphics, $iPixelOffsetMode) Local $aResult = DllCall($ghGDIPDll, "uint", "GdipSetPixelOffsetMode", "hwnd", $hGraphics, "int", $iPixelOffsetMode) If @error Then Return SetError(@error, @extended, False) $GDIP_STATUS = $aResult[0] Return $aResult[0] = 0 EndFunc ;==>_GDIPlus_GraphicsSetPixelOffsetMode ; #FUNCTION# ==================================================================================================================== ; Name...........: _GDIPlus_GraphicsSetInterpolationMode ; Description ...: Sets the interpolation mode of a Graphics object ; Syntax.........: _GDIPlus_GraphicsSetInterpolationMode($hGraphics, $iInterpolationMode) ; Parameters ....: $hGraphics - Pointer to a Graphics object ; $iInterpolationMode - Interpolation mode: ; |0 - Default interpolation mode ; |1 - Low-quality mode ; |2 - High-quality mode ; |3 - Bilinear interpolation. No prefiltering is done ; |4 - Bicubic interpolation. No prefiltering is done ; |5 - Nearest-neighbor interpolation ; |6 - High-quality, bilinear interpolation. Prefiltering is performed to ensure high-quality shrinking ; |7 - High-quality, bicubic interpolation. Prefiltering is performed to ensure high-quality shrinking ; 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 .......: The interpolation mode determines the algorithm that is used when images are scaled or rotated ; Related .......: _GDIPlus_GraphicsGetInterpolationMode ; Link ..........; @@MsdnLink@@ GdipSetInterpolationMode ; Example .......; No ; =============================================================================================================================== Func _GDIPlus_GraphicsSetInterpolationMode($hGraphics, $iInterpolationMode) Local $aResult = DllCall($ghGDIPDll, "uint", "GdipSetInterpolationMode", "hwnd", $hGraphics, "int", $iInterpolationMode) If @error Then Return SetError(@error, @extended, False) $GDIP_STATUS = $aResult[0] Return $aResult[0] = 0 EndFunc ;==>_GDIPlus_GraphicsSetInterpolationMode
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
أسرع طريقة لكتابة...
JavaScript | 59 sec ago
Conditional operat...
C# | 6 min ago
Internet downloade...
Python | 22 min ago
Func C#
C# | 25 min ago
My Log File
HTML 5 | 35 min ago
Untitled
C | 36 min ago
Untitled
XML | 39 min ago
11a, exc 1
C# | 41 min 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!