Jump to content

Save Image


Recommended Posts

Okay im trying to make it save a image that is displayed in Internet explorer.

I know the image name But would like to save it to the desktop as c.jpg how can i do this.

I would like to handle this without anything like mouse clicks because I want this to work on more then just my computer.

Thank you

Link to comment
Share on other sites

O that is cool but not quite what im looking for because you must do things that my script already handles to get to the image. but I found take a screen shot and if I can just have it take a screen shot of the window that would be great witch it looks like it dose.

#Include <ScreenCapture.au3>

_ScreenCapture_CaptureWnd($sFileName, $hWnd [, $iLeft = 0 [, $iTop = 0 [, $iRight = -1 [, $iBottom = -1 [, $fCursor = True]]]]])

I belive $hWnd is for a window

But what do I put there the window title.

Also if the window is 100 pixels by 100 pixels will it get what is at 200 by 100 pixels becuase it is taking a window screen shot I assume it will just get the whole window. But I may be wrong.

Link to comment
Share on other sites

Try experimenting with this script. Like, removing the last five optional parameters of the _ScreenCapture_CaptureWnd() function.

#include <ScreenCapture.au3>

If WinExists("[Class:IEFrame]") Then
    WinActivate("[Class:IEFrame]")
    WinWaitActive("[Class:IEFrame]") ; guarantees IE window is top most.

    ; Capture 100x100 of control window within IE window starting at point 0,10 - x, y control window coordinates.
    _ScreenCapture_CaptureWnd(@DesktopCommonDir & "\c.jpg", _
            ControlGetHandle("[Class:IEFrame]", "", "Internet Explorer_Server1"), 0, 10, 100, 110, False)

    ; Capture 100x100 of IE window starting at point 0,10 - x, y IE window coordinates.
    ;_ScreenCapture_CaptureWnd(@DesktopCommonDir & "\c.jpg", WinGetHandle("[Class:IEFrame]", "" ), 0,10,100,110)

    ShellExecute(@DesktopCommonDir & "\c.jpg")
    Sleep(1000)
    Local $ret = MsgBox(33, "Decision required", "Press OK to delete image file.", WinGetHandle(""))
    If $ret = 1 Then FileDelete(@DesktopCommonDir & "\c.jpg")
EndIf
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...