Jump to content

load images


myspacee
 Share

Recommended Posts

hello to all,

sorry for post here but in general i can't find help. Question is GUI related so i post here.

some time ago i made i script that succesfull compare images )using imagemagick.

Original idea is load and sctrech different image formats, snapshot them and compare taken shapshots.

post image to explain better:

Posted Image

to load images i use buldin xp/2003 component "Windows Picture and Fax Viewer" (GDI+)

ObjCreate("Preview.Preview.1")

My request, is possible to load different images format in a GUI using only Autoit ?

(need this because my script works only in xp/2003 environment)

thank you for your time,

m.

Edited by myspacee
Link to comment
Share on other sites

Don't know if this will work, I cut a lot of stuff out of it. But it should at least point you in the right direction.

#include <GUIConstantsEx.au3>
#include <GDIPlus.au3>
$pillx = @desktopwidth/2 + 180
$pilly = @desktopheight/2-80

$dr = GUICreate("",@desktopwidth-5,@desktopheight-5,0,0)
GUISetState(@SW_SHOW,$dr)
_gdiplus_startup()

$graphic = _GDIPlus_GraphicsCreateFromHWND($dr)
$image = _gdiplus_imageloadfromfile(@scriptdir & "/rb.png")
_GDIPlus_GraphicsDrawImageRect($graphic,$image,$pillx,$pilly,300,300)
While 1
    $msg = GUIGetMsg()
    Select
    Case $msg = $gui_event_close
        _GDIPlus_GraphicsDispose($Graphic)
        _GDIPlus_ImageDispose($rbpill)
        _GDIPlus_ShutDown()
        Exit
    EndSelect
    Sleep(10)
WEnd

Edit: changed the image size from 30 to 300 so you can see it better :)

Edited by youknowwho4eva

Giggity

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...