Jump to content
Sign in to follow this  
myspacee

load images

Recommended Posts

myspacee

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

Share this post


Link to post
Share on other sites
youknowwho4eva

Look into _gdiplus_imageloadfromfile. I just started playing with it myself. very nice.


Giggity

Share this post


Link to post
Share on other sites
myspacee

nice tip,

used before to snapshoot tool made in past

Can suggest how use to put (and see) image in a GUI ?

m.

Share this post


Link to post
Share on other sites
youknowwho4eva

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

Share this post


Link to post
Share on other sites
myspacee

BIG step in the right direction. Rewriting script to use it.

Post here update code.

Thank you.

m.

Share this post


Link to post
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
Sign in to follow this  

×