AutoHotkey Community

It is currently May 27th, 2012, 10:32 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 21 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: April 4th, 2005, 11:47 pm 
Offline

Joined: November 8th, 2004, 12:46 am
Posts: 1271
Thanks Titan. :) I was wondering whether to scrap the customisable colors in favor of using a standard tooltip since that changes its position when you reach the edge of the right/bottom of the screen automatically. It'd be nice to have the best of both. :)

I added this to the code:

Code:
if (MouseX >= (A_ScreenWidth * 0.90))
  textx := MouseX - 80
else
  textx := MouseX + 20

if (MouseY >= (A_ScreenHeight * 0.92))
  texty := MouseY - 40
else
  texty := MouseY + 20

_________________
"Anything worth doing is worth doing slowly." - Mae West
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 5th, 2005, 12:18 am 
Offline
User avatar

Joined: August 11th, 2004, 1:47 am
Posts: 5347
Location: UK
I also found that reducing the SetTimer delay to 10 greatly improves performance (reduces, infact eleminates lag time) and it doesn't cause any 'side-effects'.

_________________
GitHubScriptsIronAHK Contact by email not private message.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 5th, 2005, 12:23 am 
Offline

Joined: November 8th, 2004, 12:46 am
Posts: 1271
Thats interesting, I find on my computer its redraw gets flaky on timer values less than 50. Perhaps this should be specifiable via the ini file?

_________________
"Anything worth doing is worth doing slowly." - Mae West
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 5th, 2005, 12:39 am 
Offline
User avatar

Joined: August 11th, 2004, 1:47 am
Posts: 5347
Location: UK
Serenity wrote:
I find on my computer its redraw gets flaky
I've noticed this too (with SetTimer @10) but here's something that I found stops that:
Code:
; just after "GuiControl, ..." line in 'Get' routine
If (color_pre = color)
   Gui, Show
else
   Gui, Show, NoActivate w70 h25 x%textx% y%texty%, pixelget2
colour_pre = %color%
Return

_________________
GitHubScriptsIronAHK Contact by email not private message.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 26th, 2005, 9:53 pm 
Only issue i see (besides it being otherwise great) is it falls behind Always-On-Top windows.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 26th, 2005, 11:05 pm 
Offline

Joined: November 8th, 2004, 12:46 am
Posts: 1271
Thanks BlindWanderer. Perhaps you might find the tooltip version of this script preferable, it seems theres nothing that can be done to change this (unless pixelget2 was forced to stay the active window?) as the gui in pixelget2 is already set to always on top. I find if pixelget2 is launched whilst the always on top window was active, pixelget2 will show on top of that window.

Code:
; pixelget3 - tooltip version

#singleinstance force
setbatchlines, -1
setwindelay, -1
menu, tray, tip, pixelget3
CoordMode, Mouse, Screen
CoordMode, Pixel, Screen
toggle = 0

IniRead, Clpbrd, settings.ini, to clipboard, hotkey
IniRead, Cllct, settings.ini, collect colors, hotkey
IniRead, Mode, settings.ini, color mode, hex/dec

Hotkey, %Clpbrd%, Clipboard
Hotkey, %Cllct%, Collect
sleep, 100

SetTimer, Get, 50

Menu, Tray, NoStandard
Menu, Tray, Click, 1
Menu, Tray, Add, &Show/Hide, View
Menu, Tray, Default, &Show/Hide
Menu, Tray, Add, &Edit Settings, Settings
Menu, Tray, Add, &Reload, Reload
Menu, Tray, Add, E&xit, Exit
return

Get:
  MouseGetPos, x, y ; get mouse coords
  PixelGetColor, color, %x%, %y%, RGB ; get pixel color
  ToolTip, %color%
  return

Clipboard:
  StringTrimLeft, color, color, 2
  if mode = dec
    gosub, hex2dec
  else
    Clipboard = %color%
    return

Collect:
  StringTrimLeft, color, color, 2
  if mode = dec
  {
    gosub, hex2dec
    FileAppend, %color%`n, colors.txt
    return   
  }
  else
    Clipboard = %color%
    FileAppend, %color% `n, colors.txt
    return

View:
if toggle = 0
{
  toggle = 1
  Gui, Submit
  SetTimer, Get, off
  tooltip
  pause
  suspend
}
else
{
  toggle = 0
  SetTimer, Get, 100
  pause
  suspend
}
return

Settings:
run, settings.ini
return

Reload:
reload
return

^Q::
Exit:
exitapp

hex2dec:
  StringMid, r, color, 1, 2
  StringMid, g, color, 3, 2
  StringMid, b, color, 5, 2

  red = 0x%r%
  green = 0x%g%
  blue = 0x%b%

  SetFormat, integer, d
  red += 0
  green +=0
  blue +=0
  SetFormat, integer, hex

color = %red%`,%green%`,%blue%
Clipboard = %color%
return

_________________
"Anything worth doing is worth doing slowly." - Mae West
Image


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 21 posts ]  Go to page Previous  1, 2

All times are UTC [ DST ]


Who is online

Users browsing this forum: specter333 and 11 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group