James Posted June 19, 2007 Share Posted June 19, 2007 (edited) expandcollapse popup#cs Name: AZoom Author: James Brooks aka Secure_ICT Description: Zooms *2 under the mouse #ce #include <GUIConstants.au3> HotKeySet("{ESC}", "Quit") ; We set a hotkey so we can exit ; Were making a 20x20 window Global $GUI_Pixel[400] Global $GUI = GUICreate("AZoom", 80, 80, @DesktopWidth / 2 * 1.84, @DesktopHeight / 4 * 3.418, $WS_POPUP + $WS_BORDER, $WS_EX_TOPMOST, $WS_EX_TOOLWINDOW) ; We now need to start a count so we can go through the script $Count = 0 ; Now we make lots of label which are 4x4. We do this so that we can later color them from what is under the mouse. For $dX = 0 To 79 Step 4 For $dY = 0 To 79 Step 4 $GUI_Pixel[$Count] = GUICtrlCreateLabel("", $dX, $dY, 4, 4) $Count += 1 Next Next GUISetState(@SW_SHOW) Global $LPos[2] = [0, 0] While 1 $Count = 0 $Pos = MouseGetPos() ; We need to get the mouse position, so we can call different arrays ; As we are magnifying a 20x20 section under the mouse ; We start with a negative number for each loop. This is strange but it still counts to 20x20 For $dX = -10 To 9 For $dY = -10 To 9 GUICtrlSetBkColor($GUI_Pixel[$Count], PixelGetColor($Pos[0] + $dX, $Pos[1] + $dY)) $Count += 1 Next Next ; Now that we have this, we can see animations under the mouse ; We sleep so that we dont use all our CPU usage Sleep(10) WEnd ; We now make a function so that we can exit Func Quit() Exit EndFunc ;==>QuitThis is another part of the ColorUnderMouse. I may merge them together to create a good script which, will show the colour and allow you to zoom on that pixel.Screenshot:The window looks like this:http://www.autoitscript.com/fileman/users/public/Secure_ICT/example.JPG It sits in the bottom right of the desktop, I hope. I could only test it on a 1024x768 Resolution Edit: Added comments to the script as Manadar suggested Edited June 19, 2007 by Secure_ICT Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
Cyber Posted June 19, 2007 Share Posted June 19, 2007 Funny Console Browse: Navigate on the WEB in a textual consoleMultiPing!: Show computer on the lan and/or show the local/remote task, ALL animated!KillaWin: Event executingCryptPage: Crypt your webpage and show only with key Link to comment Share on other sites More sharing options...
James Posted June 19, 2007 Author Share Posted June 19, 2007 Thanks! Although, why funny? It magnifys under your mouse Oh well.. Glad you like it! Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
i542 Posted June 19, 2007 Share Posted June 19, 2007 (edited) Cool, I like it!(Does posting in your topics counts )Read This! Edited June 19, 2007 by i542 I can do signature me. Link to comment Share on other sites More sharing options...
BrettF Posted June 19, 2007 Share Posted June 19, 2007 Coolies I like it Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
jvanegmond Posted June 19, 2007 Share Posted June 19, 2007 Nice and easy. Comment this script and you have a good example for newbies to learn from. github.com/jvanegmond Link to comment Share on other sites More sharing options...
James Posted June 19, 2007 Author Share Posted June 19, 2007 Yes, i542, I will let you off. Thanks Bert I will do that now Manadar! Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
Toady Posted June 19, 2007 Share Posted June 19, 2007 Cool, nice job! www.itoady.com A* (A-star) Searching Algorithm - A.I. Artificial Intelligence bot path finding Link to comment Share on other sites More sharing options...
jvanegmond Posted June 19, 2007 Share Posted June 19, 2007 Thanks for the commenting. github.com/jvanegmond Link to comment Share on other sites More sharing options...
SleepyXtreme Posted June 19, 2007 Share Posted June 19, 2007 This is great but i have a few comments! You should make it so it has multiple zooms, for instance 2x,3x,4x and the box should be much bigger than 20 x 20. also, the gui should follow the mouse around so when you put the mouse on something it zooms in on the target so you don't have to look at the bottom right all the time. These suggestions are based on real programs that i've seen which do the same thing. Link to comment Share on other sites More sharing options...
Gif Posted June 19, 2007 Share Posted June 19, 2007 This is great but i have a few comments!You should make it so it has multiple zooms, for instance 2x,3x,4x and the box should be much bigger than 20 x 20. also, the gui should follow the mouse around so when you put the mouse on something it zooms in on the target so you don't have to look at the bottom right all the time.These suggestions are based on real programs that i've seen which do the same thing.like windows magnifiernice program but you could work it more creating a real gui to setting the possetion of the window, and as sleepyXtreme said you should add multiple zooms Link to comment Share on other sites More sharing options...
James Posted June 19, 2007 Author Share Posted June 19, 2007 Thanks. I will do that tomorrow. Should I add my ColorUnderMouse script in? Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
jvanegmond Posted June 19, 2007 Share Posted June 19, 2007 Scroll wheel to change zooming level? That would be awesome. github.com/jvanegmond Link to comment Share on other sites More sharing options...
DW1 Posted June 19, 2007 Share Posted June 19, 2007 thought I would let you know it runs fine in 1600 X 1200 AutoIt3 Online Help Link to comment Share on other sites More sharing options...
James Posted June 20, 2007 Author Share Posted June 20, 2007 Manadar, that is an excellent idea. Thanks danwilli, so it sits perfectly in the corner. Well the maths should make it work on any size screen, as it doesnt use full numbers exactly. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
jvanegmond Posted June 20, 2007 Share Posted June 20, 2007 Another idea: Ctrl + F to freeze. Hover over any of the pixels that are magnified and click them to get the Hex color copied to your clipboard. github.com/jvanegmond Link to comment Share on other sites More sharing options...
PantZ4 Posted August 15, 2007 Share Posted August 15, 2007 (edited) Nice tool. Hmm I read some of the comments and it seems that either James has left this or forgotten it. Either way I have did some of the few thing people has requested. Though most of it does not work . I got the mouse wheel thing down, (Please report if it works on your computer. Seems the return value is depending on some other factors which I do not know about. I used WinXP Home SP2 and it worked fine here.) I just need to apply it to the zoom too. Only the text will change. The time limit is because it seems if you scroll fast enough just will go below 0 and the program will crash. There there is a 150 milliseconds time limit. I have also remove the "flicker". James updated it all the time even if there was no change, therefore there came flicker sometimes. I just stored the old pixel values and when it updates it compares to see if there is any changes. If not, no updating. The gui resize is also a pain in the ass =X. The small zoom view will not go out of the screen any more. It will just change position instead. Also if the zoom window is not active it will not follow the mouse, yet still update. I hope you don't mind what I have done James For now, homework. But I will come back later. (The code is a bit messy right now and no comments, sorry. Feel free to clean it up ) expandcollapse popup#include <GUIConstants.au3> #include <Misc.au3> Global $GUIZOOM, $GUIINFO Global $GUIWIDTH[2],$GUIHEIGHT[2],$GUIMINWIDTH[2],$GUIMINHEIGHT[2],$GUIMAXWIDTH[2],$GUIMAXHEIGHT[2] $GUIWIDTH[0] = 80 $GUIHEIGHT[0] = 80 $GUIWIDTH[1] = 120 $GUIHEIGHT[1] = 150 $GUIMINWIDTH[0] = 80 $GUIMINHEIGHT[0] = 80 $GUIMAXWIDTH[0] = @DesktopWidth $GUIMAXHEIGHT[0] = @DesktopHeight Global $GUIZOOMSIZE = 0 Global $GUIZOOMSIZELABEL[19] $GUIZOOMSIZELABEL[0]="1.00" $GUIZOOMSIZELABEL[1]="1.20" $GUIZOOMSIZELABEL[2]="1.40" $GUIZOOMSIZELABEL[3]="1.60" $GUIZOOMSIZELABEL[4]="1.80" $GUIZOOMSIZELABEL[5]="2.00" $GUIZOOMSIZELABEL[6]="2.25" $GUIZOOMSIZELABEL[7]="2.50" $GUIZOOMSIZELABEL[8]="2.75" $GUIZOOMSIZELABEL[9]="3.00" $GUIZOOMSIZELABEL[10]="4.00" $GUIZOOMSIZELABEL[11]="5.00" $GUIZOOMSIZELABEL[12]="6.00" $GUIZOOMSIZELABEL[13]="7.00" $GUIZOOMSIZELABEL[14]="8.00" $GUIZOOMSIZELABEL[15]="9.00" $GUIZOOMSIZELABEL[16]="10.00" $GUIZOOMSIZELABEL[17]="11.00" $GUIZOOMSIZELABEL[18]="12.00" Global $GUIZOOMLABLE Global $GUITEMPPIXEL[6400] Global $SetZoomSizeTimeout = 150 Global $SetZoomSizeTime = $SetZoomSizeTimeout HotKeySet("{ESC}", "Quit") Global $GUI_Pixel[400] Global $GUIZOOM = GUICreate("AZoom", $GUIWIDTH[0], $GUIHEIGHT[0], MouseGetPos(0)+10, MouseGetPos(1)+10, $WS_POPUP + $WS_SIZEBOX, $WS_EX_TOPMOST) GUISetBkColor(0xFFFFFF) $Count = 0 ; Now we make lots of label which are 4x4. We do this so that we can later color them from what is under the mouse. For $dX = 0 To 79 Step 4 For $dY = 0 To 79 Step 4 $GUI_Pixel[$Count] = GUICtrlCreateLabel("", $dX, $dY, 4, 4,-1) GUICtrlSetState(-1,$GUI_DISABLE) $Count += 1 Next Next $GUIZOOMLABLE=GUICtrlCreateLabel("x1.0",2.5,67.5,32) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetResizing(-1,$GUI_DOCKLEFT+$GUI_DOCKBOTTOM+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT) GUISetState(@SW_SHOW) AdlibEnable("UpdateZoom",10) GUIRegisterMsg(0x020A ,"SetZoomSize") GUIRegisterMsg(0x24, "SetGUIResize") While 1 Sleep(10) WEnd Func SetZoomSize($hWndGUI, $MsgID, $WParam, $LParam) If TimerDiff($SetZoomSizeTime) > $SetZoomSizeTimeout Then If $WParam = 0x00780000 And $GUIZOOMSIZE < 18 Then $GUIZOOMSIZE += 1 GUICtrlSetData($GUIZOOMLABLE,"x"&$GUIZOOMSIZELABEL[$GUIZOOMSIZE]) ElseIf $WParam = 0xFF880000 And $GUIZOOMSIZE > 0 Then $GUIZOOMSIZE -= 1 GUICtrlSetData($GUIZOOMLABLE,"x"&$GUIZOOMSIZELABEL[$GUIZOOMSIZE]) EndIf $SetZoomSizeTime = TimerInit() EndIf EndFunc Func UpdateZoom() $MouseTempPos = MouseGetPos() If WinActive($GUIZOOM)=1 And _IsPressed(01)=0 Then $GUITempMoveX = $MouseTempPos[0]+10 $GUITempMoveY = $MouseTempPos[1]+10 If $GUITempMoveX > @DesktopWidth-$GUIWIDTH[0]-10 Then $GUITempMoveX = $MouseTempPos[0]-$GUIWIDTH[0]-16 EndIf If $GUITempMoveY > @DesktopHeight-$GUIHEIGHT[0]-10 Then $GUITempMoveY = $MouseTempPos[1]-$GUIHEIGHT[0]-16 EndIf WinMove($GUIZOOM,"",$GUITempMoveX,$GUITempMoveY) EndIf $Count = 0 ; As we are magnifying a 20x20 section under the mouse ; We start with a negative number for each loop. This is strange but it still counts to 20x20 For $dX = -10 To 9 For $dY = -10 To 9 If $GUITEMPPIXEL[$Count] <> PixelGetColor($MouseTempPos[0] + $dX, $MouseTempPos[1] + $dY) Then GUICtrlSetBkColor($GUI_Pixel[$Count], PixelGetColor($MouseTempPos[0] + $dX, $MouseTempPos[1] + $dY)) $GUITEMPPIXEL[$Count] = PixelGetColor($MouseTempPos[0] + $dX, $MouseTempPos[1] + $dY) EndIf $Count += 1 Next Next EndFunc Func Quit() Exit EndFunc Func SetGUIResize($hWnd, $Msg, $wParam, $lParam) $DLLSTRUCT = DllStructCreate("int;int;int;int;int;int;int;int;int;int",$lParam) DllStructSetData($DLLSTRUCT,7,$GUIMINWIDTH[0]) DllStructSetData($DLLSTRUCT,8,$GUIMINHEIGHT[0]) DllStructSetData($DLLSTRUCT,9,$GUIMAXWIDTH[0]) DllStructSetData($DLLSTRUCT,10,$GUIMAXHEIGHT[0]) Return 0 EndFunc Edited August 15, 2007 by Mr. Zero Link to comment Share on other sites More sharing options...
James Posted August 15, 2007 Author Share Posted August 15, 2007 Nice work Mr.Zero, although magnifying doesn't work Windows XP Pro SP2 Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
PantZ4 Posted August 15, 2007 Share Posted August 15, 2007 Nice work Mr.Zero, although magnifying doesn't work Windows XP Pro SP2Hmm as in zooming in and out or just displays the white background?Zooming in and out has not been implemented yet. Which, I hope, will come in time.I haven't touch the magnifying. No variables has been renamed or changed.Function is as the one you made. Blame yourself Funny, works perfect for me. Link to comment Share on other sites More sharing options...
Achilles Posted August 16, 2007 Share Posted August 16, 2007 Nice script, one quick suggestion: Modify the tray icon or get rid of it. My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] 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