Sign in to follow this  
Followers 0
Uriziel01

PIXEL-it :)

6 posts in this topic

#1 ·  Posted (edited)

I have realy a lot of free time last days and im writing, im writing a lot :)

I now that isnt any usefull script, but i think it is good for learning of AutoIt for newbies :)

Turning "Lite Version" ON, is usualy increasing performance by 400-500% :D

Some screens:

Posted Image

And Download:

http://www.speedyshare.com/436760382.html

p.s-Oh yeah! Big THX for Xenobiologist for _paintPixel func and for Zedna (you now for what! :) )

;######## By Uriziel01 2008 ######
#include<GUIConstantsEx.au3>
#include <String.au3>
#include <array.au3>
#include<WindowsConstants.au3>
Opt('GUICloseOnESC', 1)
Opt('GUIOnEventMode', 1)
Opt("WinTitleMatchMode", 4)
$guii= GUICreate("Zoomix2",180, 135,-1,-1,$WS_POPUP)
$effects=GUICtrlCreateList ("", 5,5,121,97)
GUICtrlSetData(-1,"Negative|BW|Boom|GreyScale|Sepia|Mozaika|Dark|Sharp|TV|TV2|Med|Max|New|SierpinskiTraingles|Dueto




ne|Pixelize|Light|Snow|ColorSnow","Negative")
GUICtrlCreateLabel ("Choose effect and press ENTER",5,100)
GUICtrlSetColor(-1,0xff0000)
$lite = GUICtrlCreateCheckbox ("Lite version ?", 5, 117, 15, 15)
GUICtrlCreateLabel ("Lite version ?",25,117)
GUICtrlSetColor(-1,0xff0000)
GUISetState()
$dll = DllOpen("user32.dll")
GUISetBkColor(0x000000)
While 1
    $msg = GUIGetMsg()
    if _IsPressed("D", $dll)  then Exitloop
            GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked")
        Wend
        $effect=GUICtrlRead($effects)
        $lite=GUICtrlRead($lite)
        if $lite = 1 then $lite = 2
                if $lite = 4 then $lite = 1
        GUIDelete($guii)
Global $shell = WinGetPos("classname=Shell_TrayWnd")
Global $gui = GUICreate("Zoomix2", 160, 160, @DesktopWidth - 160, @DesktopHeight - 160 - $shell[3], $WS_POPUP, $WS_EX_TOPMOST)
GUISetState(@SW_SHOW)
GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked")
Global $iii=0, $i=0, $q=0, $ii=0, $z=1, $z2=1
While 1
    $pos_X = MouseGetPos(0)
    $pos_Y = MouseGetPos(1)
Global $colors_A = _getPixelColors($pos_X, $pos_Y, $pos_X + 150, $pos_Y + 150)
;;;;;;;;;;;;;;;;;;
    Switch $effect
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Case "Sharp"
        For $ii=0 to 148 step $lite
for $i=0 to 148 step $lite
$string = $colors_A[$i][$ii]
$string = Hex($string, 6)
$string1=StringLeft($string,2)
$string2a=StringLeft($string,4)
$string2=StringRight($string2a,2)
$string3=StringRight($string,2)
$string1=Dec($string1)
$string2=Dec($string2)
$string3=Dec($string3)
$sr1=($string1+$string2)/2
$sr2=($string2+$string3)/2
$sr3=($sr1+$sr2)/2
$sr3= Round($sr3, 0)
$string_a1=$sr3+(256*$sr3)+(256*256*$sr3)
;pierwszy etap komurki a1
$string = $colors_A[$i+1][$ii]
$string = Hex($string, 6)
$string1=StringLeft($string,2)
$string2a=StringLeft($string,4)
$string2=StringRight($string2a,2)
$string3=StringRight($string,2)
$string1=Dec($string1)
$string2=Dec($string2)
$string3=Dec($string3)
$sr1=($string1+$string2)/2
$sr2=($string2+$string3)/2
$sr3=($sr1+$sr2)/2
$sr3= Round($sr3, 0)
$string_a2=$sr3+(256*$sr3)+(256*256*$sr3)
;pierwszy etap komurki a2
$string = $colors_A[$i][$ii+1]
$string = Hex($string, 6)
$string1=StringLeft($string,2)
$string2a=StringLeft($string,4)
$string2=StringRight($string2a,2)
$string3=StringRight($string,2)
$string1=Dec($string1)
$string2=Dec($string2)
$string3=Dec($string3)
$sr1=($string1+$string2)/2
$sr2=($string2+$string3)/2
$sr3=($sr1+$sr2)/2
$sr3= Round($sr3, 0)
$string_b1=$sr3+(256*$sr3)+(256*256*$sr3)
;pierwszy etap komurki b1
$string = $colors_A[$i+1][$ii+1]
$string = Hex($string, 6)
$string1=StringLeft($string,2)
$string2a=StringLeft($string,4)
$string2=StringRight($string2a,2)
$string3=StringRight($string,2)
$string1=Dec($string1)
$string2=Dec($string2)
$string3=Dec($string3)
$sr1=($string1+$string2)/2
$sr2=($string2+$string3)/2
$sr3=($sr1+$sr2)/2
$sr3= Round($sr3, 0)
$string_b2=$sr3+(256*$sr3)+(256*256*$sr3)
;pierwszy etap komurki b2
;; Etap drugi
$string_a1 = Hex($string_a1, 6)
$string1_a1=StringLeft($string_a1,2)
$string1_a1=Dec($string1_a1)
$string_a2 = Hex($string_a2, 6)
$string1_a2=StringLeft($string_a2,2)
$string1_a2=Dec($string1_a2)
$string_b1 = Hex($string_b1, 6)
$string1_b1=StringLeft($string_b1,2)
$string1_b1=Dec($string1_b1)
$string_b2 = Hex($string_b2, 6)
$string1_b2=StringLeft($string_b2,2)
$string1_b2=Dec($string1_b2)
; etap końcowy
if $string1_a2 - $string1_a1 > 30 then 
$string1_a1=$string1_a1-20
endif
if $string1_a1 - $string1_a2 > 30 then
    $string1_a1=$string1_a1+20
endif
;;;;;;;;;;;;;;;;
if $string1_a1 - $string1_b1 > 30 then
    $string1_a1=$string1_a1+20
endif
if $string1_b1 - $string1_a1 > 30 then
    $string1_a1=$string1_a1-20
EndIf
;;;;;;;;;;;;;;;;
if $string1_a1 - $string1_b2 > 30 then
    $string1_a1=$string1_a1+20
endif
if $string1_b2 - $string1_a1 > 30 then
    $string1_a1=$string1_a1-20
endif
if $string1_a1 > 250 then $string1_a1 = 250
    if $string1_a1 < 5 then $string1_a1 = 5
;;;;;;;;;;;;;
; Zakończenie funkcji
$string1=$string1_a1+(256*$string1_a1)+(256*256*$string1_a1)
$string1 = Hex($string1, 2)
$sr3=Dec($string1)
$string1_a1=$sr3+(256*$sr3)+(256*256*$sr3)
$colors_A[$i][$ii]=$string1_a1
next
Next
;;;;;;;;;   
;;;;;;;;;;
    
    Case "TV2"
    for $ii=0 to 145 step 1 
        $q=$q+1
        Switch $q
        case 0 to 2
             $q2=4
        case 2 to 3
            $q2=15
        case 4 to 5
            $q2=39
        case 5 to 6
            $q2=39
        case 6 to 7
             $q2=15
        case 7 to 8
            $q2=0
        case 8 to 9
             $q2=4
        case else
             $q=0
            EndSwitch
    for $i=0 to 149 step 1
$string = $colors_A[$i][$ii]
$string = Hex($string, 6)
$string1=StringLeft($string,2)
$string2a=StringLeft($string,4)
$string2=StringRight($string2a,2)
$string3=StringRight($string,2)
$string1=Dec($string1)
$string2=Dec($string2)
$string3=Dec($string3)
$string1=$string1-$q2
$string2=$string2-$q2
$string3=$string3-$q2
if $string1 < 5 then $string1=5
    if $string2 < 5 then $string2=5
        if $string3 < 5 then $string3=5
            $string=$string1+(256*$string2)+(256*256*$string3)
    $colors_A[$i][$ii]=$string      
Next
Next
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Case "TV"
        For $ii=0 to 149 step $lite
                $iii=$iii+1
for $i=0 to 149 step $lite
$string = $colors_A[$i][$ii]
if $iii = 1 then $string =5263440
if $iii = 2 then $string =9474192
if $iii = 3 then $string =5263440

    if $iii=9 then $iii=0
     $colors_A[$i][$ii]=$string
next
Next
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Case "Med"
        For $ii=0 to 149 step $lite
for $i=0 to 149 step $lite
$string = $colors_A[$i][$ii]
if $string <> 16777215 and $string <> 0 then
$string = Hex($string, 6)
    $string=StringReplace($string,"1","5")
    $string=StringReplace($string,"2","5")
    $string=StringReplace($string,"3","5")
    $string=StringReplace($string,"4","5")
    $string=StringReplace($string,"5","6")
    $string=StringReplace($string,"6","6")
    $string=StringReplace($string,"7","7")
    $string=StringReplace($string,"8","7")
    $string=StringReplace($string,"9","8")
    $string=StringReplace($string,"A","9")
    $string=StringReplace($string,"B","9")
    $string=StringReplace($string,"C","A")
    $string=StringReplace($string,"D","A")
    $string=StringReplace($string,"E","B")
    $string=StringReplace($string,"F","B")
    $string = Dec($string)
    $colors_A[$i][$ii]=$string
    endif
next
Next
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Case "Max"
        For $ii=0 to 149 step $lite
for $i=0 to 149 step $lite
$string = $colors_A[$i][$ii]
if $string <> 16777215 and $string <> 0 then
$string = Hex($string, 6)
    $string=StringReplace($string,"1","1")
    $string=StringReplace($string,"2","1")
    $string=StringReplace($string,"3","2")
    $string=StringReplace($string,"4","2")
    $string=StringReplace($string,"5","3")
    $string=StringReplace($string,"6","5")
    $string=StringReplace($string,"7","6")
    $string=StringReplace($string,"8","7")
    $string=StringReplace($string,"9","10")
    $string=StringReplace($string,"A","B")
    $string=StringReplace($string,"B","C")
    $string=StringReplace($string,"C","E")
    $string=StringReplace($string,"D","E")
    $string=StringReplace($string,"E","F")
    $string=StringReplace($string,"F","F")
    $string = Dec($string)
    $colors_A[$i][$ii]=$string
EndIf
next
Next
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Case "Dark"
    For $ii=0 to 149 step $lite
for $i=0 to 149 step $lite
$string = $colors_A[$i][$ii]
if $string <> 0 then
$string = Hex($string, 6)
    $string=StringReplace($string,"1","0")
    $string=StringReplace($string,"2","0")
    $string=StringReplace($string,"3","1")
    $string=StringReplace($string,"4","2")
    $string=StringReplace($string,"5","3")
    $string=StringReplace($string,"6","4")
    $string=StringReplace($string,"7","5")
    $string=StringReplace($string,"8","6")
    $string=StringReplace($string,"9","7")
    $string=StringReplace($string,"A","8")
    $string=StringReplace($string,"B","9")
    $string=StringReplace($string,"C","A")
    $string=StringReplace($string,"D","B")
    $string=StringReplace($string,"E","B")
    $string=StringReplace($string,"F","C")
    $string = Dec($string)
    $colors_A[$i][$ii]=$string
    endif
next
Next
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Case "Light"
    For $ii=0 to 149 step $lite
for $i=0 to 149 step $lite
$string = $colors_A[$i][$ii]
if $string <> 0 then
$string = Hex($string, 6)
    $string=StringReplace($string,"D","F")
    $string=StringReplace($string,"C","E")
    $string=StringReplace($string,"B","D")
    $string=StringReplace($string,"A","C")
    $string=StringReplace($string,"9","A")
    $string=StringReplace($string,"8","9")
    $string=StringReplace($string,"7","8")
    $string=StringReplace($string,"6","7")
    $string=StringReplace($string,"5","6")
    $string=StringReplace($string,"4","5")
    $string=StringReplace($string,"3","5")
    $string=StringReplace($string,"2","4")
    $string=StringReplace($string,"1","3")
    $string = Dec($string)
    $colors_A[$i][$ii]=$string
    endif
next
Next
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Case "Blur"
    For $ii=1 to 147 step $lite
for $i=1 to 147 step $lite
$string = $colors_A[$i][$ii]
$string = Hex($string, 6)
$string1=StringLeft($string,2)
$string2a=StringLeft($string,4)
$string2=StringRight($string2a,2)
$string3=StringRight($string,2)
$string1=Dec($string1)
$string2=Dec($string2)
$string3=Dec($string3)
next
Next
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Case "GreyScale"
    For $ii=0 to 149 step $lite
for $i=0 to 149 step $lite
$string = $colors_A[$i][$ii]
$string = Hex($string, 6)
$string1=StringLeft($string,2)
$string2a=StringLeft($string,4)
$string2=StringRight($string2a,2)
$string3=StringRight($string,2)
$string1=Dec($string1)
$string2=Dec($string2)
$string3=Dec($string3)
$sr1=($string1+$string2)/2
$sr2=($string2+$string3)/2
$sr3=($sr1+$sr2)/2
$sr3= Round($sr3, 0)
$string=$sr3+(256*$sr3)+(256*256*$sr3)
    $colors_A[$i][$ii]=$string
next
Next
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Case "BW"
    For $ii=0 to 149 step $lite
for $i=0 to 149 step $lite
$string = $colors_A[$i][$ii]
if $string <> 16777215 and $string <> 0 then
$string = Hex($string, 6)
$string1=StringLeft($string,2)
$string2a=StringLeft($string,4)
$string2=StringRight($string2a,2)
$string3=StringRight($string,2)
$string1=Dec($string1)
$string2=Dec($string2)
$string3=Dec($string3)
if $string1+$string2+$string3 > 199 then 
    $string = 16777215
Else
    $string=0
    endif
    $colors_A[$i][$ii]=$string
    endif
next
Next
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Case "Sepia"
        For $ii=0 to 149 step $lite
for $i=0 to 149 step $lite
$string = $colors_A[$i][$ii]
$string = Hex($string, 6)
$string1=StringLeft($string,2)
$string2a=StringLeft($string,4)
$string2=StringRight($string2a,2)
$string3=StringRight($string,2)
$string1=Dec($string1)
$string2=Dec($string2)
$string3=Dec($string3)
    $sr1=($string1+$string2)/2
$sr2=($string2+$string3)/2
$sr3=($sr1+$sr2)/2
$sr3= Round($sr3, 0)
$string1=$sr3+80
$string2=$sr3+40
$string3=$sr3-20
if $string1 > 255 then $string1=255
if $string2 > 255 then $string2=255
if $string3 < 5 then $string3=15
$string=$string1+(256*$string2)+(256*256*$string3)
    $colors_A[$i][$ii]=$string
next
Next
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Case "Mozaika"
        For $ii=0 to 149 step $lite
for $i=0 to 149  step $lite
$string=Random(1,14345697)
    $colors_A[$i][$ii]=$string
next
Next
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Case "Snow"
        For $ii=0 to 149 step $lite
for $i=0 to 149  step $lite
    $string = $colors_A[$i][$ii]
    if Random(10,1000) < 50 then $string=16777215
    $colors_A[$i][$ii]=$string
next
Next
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Case "ColorSnow"
        For $ii=0 to 149 step $lite
for $i=0 to 149  step $lite
    $string = $colors_A[$i][$ii]
    if Random(10,1000) < 50 then $string=Random(1,14345697)
    $colors_A[$i][$ii]=$string
next
Next
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Case "Pixelize"
        For $ii=1 to 148 step 2 
for $i=1 to 145 step 2 
    $string = $colors_A[$i][$ii]
    $colors_A[$i-1][$ii-1]=$string
    $colors_A[$i-1][$ii]=$string
    $colors_A[$i][$ii-1]=$string
    $colors_A[$i+1][$ii]=$string
    $colors_A[$i][$ii+1]=$string
    $colors_A[$i+1][$ii+1]=$string
    $colors_A[$i-1][$ii+1]=$string
    $colors_A[$i+1][$ii-1]=$string
next
Next
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Case "SierpinskiTraingles"
    for $ii=2 to 146 step 2
for $i=2 to 146 step 2
    $string = $colors_A[$i/2][$ii/2]
    $colors_A[$i-1][$ii-1]=$string
    $colors_A[$i-1][$ii]=$string
    $colors_A[$i][$ii-1]=$string
    $colors_A[$i+1][$ii]=$string
    $colors_A[$i][$ii+1]=$string
    $colors_A[$i+1][$ii+1]=$string
    $colors_A[$i-1][$ii+1]=$string
    $colors_A[$i+1][$ii-1]=$string
next
Next
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Case "Zoom"
    Local $y=0,$y2=0,$z=2,$z2=2
        For $ii=2 to 146 step 2
            $y2=$y2+1
            $z2=$y2
            $z=0
            $y=0
for $i=2 to 146 step 2
    $y=$y+1
    $z=$y
    if $i = 2 then $string = $colors_A[$z][$z2]
    if $i > 1 then $string = $colors_A[$z+1][$z2]
    $colors_A[$i-1][$ii-1]=$string
    $colors_A[$i-1][$ii]=$string
    $colors_A[$i][$ii-1]=$string
    $colors_A[$i+1][$ii]=$string
    $colors_A[$i][$ii+1]=$string
    $colors_A[$i+1][$ii+1]=$string
    $colors_A[$i-1][$ii+1]=$string
    $colors_A[$i+1][$ii-1]=$string
next
Next
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Case "Boom"
        For $ii=2 to 146 step 2
for $i=2 to 144 step 2
    $string = $colors_A[$i][$ii]
    $colors_A[$i-2][$ii+1]=$string
    $colors_A[$i+1][$ii+2]=$string
    $colors_A[$i+2][$ii-1]=$string
next
Next
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Case "Duetone"
    $k1=Random(1,12345678)
    $k2=Random(1,12345678)
        For $ii=0 to 149 step $lite
for $i=0 to 149 step $lite
$string = $colors_A[$i][$ii]
if $string > 9988607 then 
    $colors_A[$i][$ii]=$k1
Else
    $colors_A[$i][$ii]=$k2
EndIf
next
Next
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Case "Negative"
        For $ii=0 to 149 step $lite
for $i=0 to 149 step $lite
$string = $colors_A[$i][$ii]
$string = Hex($string, 6)
$string1=StringLeft($string,2)
$string2a=StringLeft($string,4)
$string2=StringRight($string2a,2)
$string3=StringRight($string,2)
$string1=Dec($string1)
$string2=Dec($string2)
$string3=Dec($string3)
$string1=255-$string1
$string2=255-$string2
$string3=255-$string3
$string=$string1+(256*$string2)+(256*256*$string3)
    $colors_A[$i][$ii]=$string
next
Next
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Case "New"
        For $ii=0 to 149 step $lite
for $i=0 to 149 step $lite
$string = $colors_A[$i][$ii]
if $string <> 0 then
$string = Hex($string, 6)
$string1=StringLeft($string,2)
$string2a=StringLeft($string,4)
$string2=StringRight($string2a,2)
$string3=StringRight($string,2)
$string1=Dec($string1)
$string2=Dec($string2)
$string3=Dec($string3)
$string1=$string1+$i-10
$string2=$string2-$ii+10
$string3=$string3+$ii-10
$string=$string1+(256*$string2)+(256*256*$string3)
    $colors_A[$i][$ii]=$string
    endif
next
Next
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
EndSwitch
;;;;;;;;;;;
    _paintPixel($colors_A, $gui, 5, 5)
WEnd
Func _getPixelColors($start_X = 0, $start_Y = 0, $end_X = @DesktopWidth, $end_Y = @DesktopHeight)
    Local $opt = Opt('ColorMode', 1)
    Local $coord[$end_X - $start_X][$end_Y - $start_Y]
    For $x = 0 To UBound($coord, 1) - 1
        For $y = 0 To UBound($coord, 2) - 1
            $coord[$x][$y] = PixelGetColor($x + $start_X, $y + $start_Y)
        Next
    Next
    Opt('ColorMode', $opt)
    Return $coord
EndFunc 

Func _paintPixel(ByRef $coord, $handle, $start_X = 0, $start_Y = 0)
    Local $dc = DllCall("user32.dll", "int", "GetDC", "hwnd", $handle)
    For $x = 0 To UBound($coord, 1) - 1 step $lite
        For $y = 0 To UBound($coord, 2) - 1 step $lite
            DllCall("gdi32.dll", "long", "SetPixel", "long", $dc[0], "long", $x + $start_X, "long", $y + $start_Y, "long", $coord[$x][$y])
        Next
    Next

    DllCall("user32.dll", "int", "ReleaseDC", "hwnd", 0, "int", $dc[0])
    Return $coord
EndFunc 
Func CLOSEClicked()
    Exit (0)
EndFunc
;######## By Uriziel01 2008 ######
Edited by Uriziel01

Share this post


Link to post
Share on other sites



Thank you very much, all I have checked out so far was the grayscale.


INI TreeViewA bus station is where a bus stops, a train station is where a train stops. Onmy desk I have a work station...

Share this post


Link to post
Share on other sites

Keep checking :) I like SierpinskiTriangles(have i translate it correctly?), Boom, Sepia :) Oh, and look out on the Sharp function, it it quite sloooooow :) 1 frame in 5 sec. ;P


Share this post


Link to post
Share on other sites

Hi,

looks funny. You could shorten the script a bit I think. Would it be faster to screenshot and then load screenshot to gui and then prepare screenshot?

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

I hope so, I've had a limited amount of time to play with it. Grayscale takes so long it's not worth doing it, when your trying to do the entire desktop.


INI TreeViewA bus station is where a bus stops, a train station is where a train stops. Onmy desk I have a work station...

Share this post


Link to post
Share on other sites

Hi,

this should be very much faster!!!

#include<WindowsConstants.au3>
#include<GUIConstantsEx.au3>
Opt("WinTitleMatchMode", 4)
Opt('GUICloseOnESC', 1)
Opt('GUIOnEventMode', 1)

$MagWidth = 150
$MagHeight = 150
$MagZoom = 1.00000000000000001
Global $dll[3], $DeskHDC, $GUIHDC

$dll[1] = DllOpen("user32.dll")
$dll[2] = DllOpen("gdi32.dll")

Global $shell = WinGetPos("classname=Shell_TrayWnd")
Global $GUI = GUICreate("Gui", 160, 160, @DesktopWidth - 160, @DesktopHeight - 160 - $shell[3], $WS_POPUP, $WS_EX_TOPMOST)
GUISetOnEvent($GUI_EVENT_CLOSE, "OnAutoItExit")
GUISetState(@SW_SHOW)

$DeskHDC = DllCall("user32.dll", "int", "GetDC", "hwnd", 0)
$GUIHDC = DllCall("user32.dll", "int", "GetDC", "hwnd", $GUI)

While 1
    MAG()
    Sleep(5)
WEnd

Func MAG()
    DllCall("gdi32.dll", "int", "StretchBlt", "int", $GUIHDC[0], "int", _
            0, "int", 0, "int", $MagWidth * $MagZoom, "int", $MagHeight * $MagZoom, "int", $DeskHDC[0], "int", _
            MouseGetPos(0) - $MagWidth / 2, "int", MouseGetPos(1) - $MagHeight / 2, "int", $MagWidth, "int", $MagHeight, _
            "long", $SRCCOPY)
EndFunc   ;==>MAG

Func OnAutoItExit()
    DllCall("user32.dll", "int", "ReleaseDC", "int", $DeskHDC[0], "hwnd", 0)
    DllCall("user32.dll", "int", "ReleaseDC", "int", $GUIHDC[0], "hwnd", $GUI)
    DllClose($dll[1])
    DllClose($dll[2])
EndFunc   ;==>OnAutoItExit

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0