AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Capture screeshots with a nice GUI (and IrfanView)
Goto page Previous  1, 2, 3, 4  Next
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
webber



Joined: 25 Aug 2005
Posts: 60

PostPosted: Thu Sep 08, 2005 7:57 pm    Post subject: Reply with quote

Quote:
Here is mine...


this one seems to be working also
_________________
winxp pro sp2
AHK v1.0.38.02

----------------------------------
One man's preacher is another man's terrorist


Last edited by webber on Fri Sep 09, 2005 6:15 am; edited 2 times in total
Back to top
View user's profile Send private message
AGU
Guest





PostPosted: Thu Sep 08, 2005 8:02 pm    Post subject: Reply with quote

Quote:
"if islabel(redobuffer)"

Had that too, I believe. I think you must update your AHK Version.
Back to top
webber



Joined: 25 Aug 2005
Posts: 60

PostPosted: Thu Sep 08, 2005 9:47 pm    Post subject: Reply with quote

Quote:

Had that too, I believe. I think you must update your AHK Version.


I'm now using the latest and greatest version and now get the error on line 524:

Quote:
"Failed attempt to launch program or document"

_________________
winxp pro sp2
AHK v1.0.38.02

----------------------------------
One man's preacher is another man's terrorist
Back to top
View user's profile Send private message
specialGuest
Guest





PostPosted: Thu Sep 08, 2005 10:09 pm    Post subject: Re: Capture screeshots with a nice GUI (and IrfanView) Reply with quote

toralf, Sir, I was working on this one too.

Had to learn, that I was miles from getting to something like that. Great script (not referring to lines of code), thanks a lot for sharing it.
I definitly will not use any longer the different tools, I installed (and installed again and again over the years), now I will stay with yours.


I suggest, to include ExeCapture in your Ini-file. I am using your tool on different machines, and - shit happens - irfanview has never the same path.

I can help myself, but I think other users will have the same problem.

Thanks, again
Back to top
AGU
Guest





PostPosted: Fri Sep 09, 2005 3:52 am    Post subject: Reply with quote

Quote:
I can help myself, but I think other users will have the same problem.
Yeah, I guess this is also webber's problem.

@webber
Did you adjust the code in line 27
Code:
ExeCapture          = i_view32.exe

It must point to your "i_view32.exe".

I already wrote that installation process is not very well documented. You can overlook that little passage in the script very easily.
Back to top
webber



Joined: 25 Aug 2005
Posts: 60

PostPosted: Fri Sep 09, 2005 5:45 am    Post subject: Reply with quote

fixing line 27 helped remove the errors , thanks,

Now I just have to figure out how to use this , not quite sure what it means by window vs screen vs other buttons.
_________________
winxp pro sp2
AHK v1.0.38.02

----------------------------------
One man's preacher is another man's terrorist
Back to top
View user's profile Send private message
Guest






PostPosted: Fri Sep 09, 2005 7:04 am    Post subject: Reply with quote

toralf wrote:

Hi 172x,
Thank you for your version. I had a look at it. I do have to remarks:

1) You use MY, MY, MXend and MYend to crop the picture. That is dangerous, since if the user has draged the frame from bottom right to upper left, the values will overlap. Since you have calculate X,Y,w,h already, you can use them and they are the correct values.

2) I didn't use the {PRINTSCREEN} /clippaste way, since it will interfere with the clipboard. Since irfanview supports directly screenshot capabilities, you can use it without this interference.

Just my 2 cents

I have taken from your script the idea to put the screenshot filename and path into "". Thanks. I have edited my post and code


Hi toralf,
Thanks for your sugggestion, here is my latest version which able to crop the picture from any direction.
Code:

Alt & Lbutton::
    irfanviewPath=C:\Application\IrfanView\i_view32.exe
    Folder=C:\Application\IrfanView\Captures

    if IsIrfanViewExist(irfanviewPATH, "i_view32.exe (IrfanView)") = 1
    {
        CoordMode, Mouse ,Screen
        MouseGetPos, Xs, Ys
        Gui, 1:Color, EEAA99
        Gui, 1:+Lastfound
        WinSet, TransColor, EEAA99
        Gui, 1:-Caption +Border
        Loop
        {
            If GetKeyState("LButton", "P")
            {
                MouseGetPos, Xe, Ye
                if (Xs < Xe) and (Ys < Ye)
                {
                    X1 := Xs
                    Y1 := Ys
                    X2 := Xe
                    Y2 := Ye
                }

                if (Xs > Xe) and (Ys < Ye)
                {
                    X1 := Xe
                    Y1 := Ys
                    X2 := Xs
                    Y2 := Ye
                }

                if (Xs < Xe) and (Ys > Ye)
                {
                    X1 := Xs
                    Y1 := Ye
                    X2 := Xe
                    Y2 := Ys
                }

                if (Xs > Xe) and (Ys > Ye)
                {
                    X1 := Xe
                    Y1 := Ye
                    X2 := Xs
                    Y2 := Ys
                }
                w := abs(Xe - Xs)
                h := abs(Ye - Ys)
                Gui, 1:Show, x%X1% y%Y1% w%w% h%h%
            }       
            Else
                Break
            }
            Gui, 1:Destroy

            file_name := GetFileName(Folder, "SCR", "JPG")
            TakeScreenShot(irfanviewPath, file_name, X1, Y1, w, h, 0)
    }
Return

TakeScreenShot(ProgramPath, TargetPath, sXpos, sYpos, vW, vH, vType)
{
    RunWait, `"%ProgramPath%`" /capture=%vType% /crop=(%sXpos%`,%sYpos%`,%vW%`,%vH%) /convert=`"%TargetPath%`", , hide
}

IsIrfanViewExist(FilePath, FileName)
{
    IfNotExist, %FilePath%
    {
        Msgbox File: %FileName% does not exist !
        return 0
    }
    else
        return 1
}

GetFileName(FilePath, FilePrefix, FileExt)
{
    FileNoCount=1
    Loop,
    {
        IfExist, %FilePath%\%FilePrefix%%FileNoCount%.%FileExt%
        {
            FileNoCount++
            continue
        }
        else
            Break
    }
    f_name = %FilePath%\%FilePrefix%%FileNoCount%.%FileExt%
    return f_name
}



I am new to AHK, I have one out of topic question, hopefully you are able to answer me.
Is it possible to change the mouse speed (e.g. mouse dpi) dynamically with AHK? I have tried "SetDefaultMouseSpeed" but not success. I like the idea of Logitech MX518 which able to change the mouse's dpi with a click of button.

Thanks
Back to top
toralf



Joined: 31 Jan 2005
Posts: 3842
Location: Bremen, Germany

PostPosted: Fri Sep 09, 2005 8:56 am    Post subject: Reply with quote

Dear Guest,

I'm sorry that I caused so much confusion. But I think that your first script was better, the current does too much math. That is not necessary. This would have been enough
Code:
            If GetKeyState("LButton", "P")
            {
                MouseGetPos, MXend, MYend
                w := abs(MX - MXend)
                h := abs(MY - MYend)
                If ( MX < MXend )
                    X := MX
                Else
                    X := MXend
                If ( MY < MYend )
                    Y := MY
                Else
                    Y := MYend
                Gui, 1:Show, x%X% y%Y% w%w% h%h%
            }       
            Else
                Break
            }
            MouseGetPos, MXend, MYend
            Gui, 1:Destroy

            file_name := GetFileName(Folder, "SCR", "JPG")
            TakeScreenShot(irfanviewPath, file_name, X, Y, w, h, 0)

The magic is in
Quote:
TakeScreenShot(irfanviewPath, file_name, X, Y, w, h, 0)
And onyl adjusting the function.

Regarding the mouse speed: AFAIK it only changes the speed of the mouse on the screen.
Quote:
The speed to move the mouse in the range 0 (fastest) to 100 (slowest). Note: a speed of 0 will move the mouse instantly.
I do not know what you mean by DPI. Do you have a optical mouse that can change its scanning dpi? I would suggest to start a new topic on this (I guess you have done so already, since I remember having seen one topic on this).
Secondly I do not knwo what you want dynamically be adjusted? Doesn't your mouse move fast enough? On Notebooks I remember to have seen an acceleration menu for mouse pointers. The longer it moves the faster it gets.
_________________
Ciao
toralf
Back to top
View user's profile Send private message Send e-mail Visit poster's website
toralf



Joined: 31 Jan 2005
Posts: 3842
Location: Bremen, Germany

PostPosted: Fri Sep 09, 2005 9:37 am    Post subject: Reply with quote

AGU wrote:
Quote:
I can help myself, but I think other users will have the same problem.
Yeah, I guess this is also webber's problem.

@webber
Did you adjust the code in line 27
Code:
ExeCapture          = i_view32.exe

It must point to your "i_view32.exe".

I already wrote that installation process is not very well documented. You can overlook that little passage in the script very easily.


I'm sorry that this caused so much confussion with the executable if IrfanView. I didn't realize that it was so difficult to spot. (Since it is the first line of code). Maybe I should have witten more then just "Adjust this".

Yes, you need the latest AHK version, as written in the header.

I have added a FileSelectFile for the IrfanView exe, so that it should be easier now. And it will save the selection to the Ini, so it will be there the next time. I hope this helps. I haven't tested though. I put this on you guys. The script doesn't check the existence of the dll though.
_________________
Ciao
toralf
Back to top
View user's profile Send private message Send e-mail Visit poster's website
hps



Joined: 19 Aug 2005
Posts: 14
Location: Germany

PostPosted: Sun Sep 11, 2005 10:58 am    Post subject: multiple monitors and irfanview path Reply with quote

Hi Toralf,

great script.

I tried to adapt Capture Region to function on the second monitor.
Code:
DrawRegionFrame:
  ;set fast execution
  SetBatchLines, -1

  ;get starting position from mouse
  MouseGetPos, MX, MY

  ;create transparent GUI covering the whole screen
  Sysget,B_ScreenWidth,78
  Sysget,B_ScreenHeight,79
  Gui, 3:Color, Black
  Gui, 3:+Lastfound +AlwaysOnTop
  WinSet, TransColor, Black
  Gui, 3:-Caption
  Gui, 3:Show, x0 y0 w%B_ScreenWidth% h%B_ScreenHeight%


I changed all occurences of A_Screen.... to B_Screen ...
Selecting a region on the second monitor works now,
but I have found out, that the /capture=0 command option in IrfanView
captures only monitor one.
If called from IrfanView Gui via Options --- Capture/Screenshot -- whole screen the whole desktop is captured.


And your Irfanview FileSelectFile at the beginning does not work,
because
Code:
%StartCenterIni%
is not initialized at this point.
Back to top
View user's profile Send private message
toralf



Joined: 31 Jan 2005
Posts: 3842
Location: Bremen, Germany

PostPosted: Sun Sep 11, 2005 4:40 pm    Post subject: Reply with quote

Hi hps,

Thanks for the feedback.

I have moved the definition of the ini file further up in the code.

I wonder what B_ScreenWidth and B_ScreenHeight are. I never heard of them. Is this normal or a environment variable that you have set on your pc? Could you or Chris please clarify?
I do not know how I should alter the code. What happens if people have 4 screens? will it then be D_ScreenWidth?
I don't think I will change it in the code. But thank you very much for the comment, if some other user comes along with this topic, he might find it here or I can tell him how to fix it.

Regarding Irfanview: I do not know how to fix it. Maybe you could try the commandline option in a command shell of your PC. It it doesn't work the way it does from the GUI, you could ask the coders of irfanview to fix it in irfanview, since they seam to be able to do it. I can't help you on this, since I have no way to test it, nor can I change irfanview.
_________________
Ciao
toralf
Back to top
View user's profile Send private message Send e-mail Visit poster's website
172x
Guest





PostPosted: Mon Sep 12, 2005 3:45 am    Post subject: Reply with quote

toralf wrote:
Dear Guest,
Regarding the mouse speed: AFAIK it only changes the speed of the mouse on the screen.The speed to move the mouse in the range 0 (fastest) to 100 (slowest). Note: a speed of 0 will move the mouse instantly.

I set SetDefaultMouseSpeed to 0 and 100 but not effect on my mouse movement.

Quote:
I do not know what you mean by DPI. Do you have a optical mouse that can change its scanning dpi? I would suggest to start a new topic on this (I guess you have done so already, since I remember having seen one topic on this).


Mouse speed is often expressed as DPI (Dots Per Inch). The DPI is the number of pixels the mouse cursor will move when the mouse is moved one inch. Most of the standard modern optical mouse works at least 800 dpi. Having a higher optical sensor means a faster and more responsive mouse. I already start a new topic, but no feedack:(

Description from internet
...an 800dpi sensor, relates to the resolution of the image taken by the mouse's CMOS camera compared to a real-world measurement, in this case, one inch. So, for a given sensor size of say, 20x20 pixels, an 800dpi sensor will see a smaller area than a 400dpi sensor, and hence, be able to track finer movements better. An increased DPI count also makes the mouse easier to use at high monitor resolutions. For example, if the mouse speed of a 400dpi sensor is set with a 1:1 ratio with no acceleration, for every inch the mouse is moved, the cursor will move 400 pixels on screen. This can be too slow for higher resolutions such as 1280x1024....

Quote:
Secondly I do not knwo what you want dynamically be adjusted? Doesn't your mouse move fast enough? On Notebooks I remember to have seen an acceleration menu for mouse pointers. The longer it moves the faster it gets.

I have a 800dpi Logtech MX500 optical mouse, and I am able to set my mouse speed with a program called LogiGamer. This program allow me to set profile for different program/games. Each profile can have difference mouse speed, so I able to set faster mouse speed for gaming and slower for normal use etc. I would like to know whether AHK can do this. If AHK can do this, I no need to get other more expensive mouse (e.g. Logitech MX518) which able to change mouse dpi without software install.

The MX 518 has a resolution of 1,600 dots-per-inch (dpi), which makes it extremely fast and accurate. This is great when you need speed, but there are times in a game when that kind of resolution can be too much of a good thing. Basically, a lower resolution means the mouse moves more slowly across the screen, and a higher one makes it zippier. By clicking on the plus or minus buttons, you can kick the resolution of the optical scanner down to 800 dpi or 400 dpi without stopping in your game, then boost it back up again whenever you want to.
If you're hunkering down to do some long-distance sniping, for example, you can push the MX 518 down to 400 dpi for more precision. Then when the enemy figures out where you're hiding, you can move up to 800 dpi by pressing the plus button to hose the enemy down with a rapid-fire weapon.....
Back to top
corrupt



Joined: 29 Dec 2004
Posts: 2419

PostPosted: Mon Sep 12, 2005 4:22 am    Post subject: Reply with quote

I may be misunderstanding, but it sounds like you would be better off leaving the DPI set for accuracy and increase/decrease the acceleration to your desired speed if possible.
Back to top
View user's profile Send private message Visit poster's website
toralf



Joined: 31 Jan 2005
Posts: 3842
Location: Bremen, Germany

PostPosted: Mon Sep 12, 2005 7:48 am    Post subject: Reply with quote

I have given a reply in your post,
http://www.autohotkey.com/forum/viewtopic.php?p=32273

since I do not what to mix it with this topic. Thanks
_________________
Ciao
toralf
Back to top
View user's profile Send private message Send e-mail Visit poster's website
corrupt



Joined: 29 Dec 2004
Posts: 2419

PostPosted: Mon Sep 12, 2005 8:00 am    Post subject: Reply with quote

toralf wrote:
since I do not what to mix it with this topic. Thanks
sorry about that Embarassed
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page Previous  1, 2, 3, 4  Next
Page 2 of 4

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group