Sign in to follow this  
Followers 0
BinaryBrother

Updating an image on a GUI... :)

8 posts in this topic

While 1

InetGet("image")

GUICtrlDelete($Pic1)

$Pic1 = GUICtrlCreatePic(@TempDir & "\ServerCapture.jpg", 0, 0, @DesktopWidth, @DesktopHeight, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))

WEnd

What I'm trying to do is as simple as pie... but it's being difficult.

I was trying to find a better way that doesn't involve the seizure causing flicker... :D

I'll take C++ examples as well... :o

Yes, this IS what it looks like... My friend over at HideAwayCyber.com wants a tool that just 'works'... VNC requires firewall exceptions, which takes forever to walk most clients through, TeamViewer is "for NON-COMMERCIAL use only..." <--- Yes, they write it in all caps... etc...etc...

I got the client and server working, and I'll share the code once it's good enough over in the examples section... I know "Radical 2" is already released, but it has a C# server, and doesn't have the 1 thing I want... "Point and click" :P

I'm trying to learn C++, so if you guys have any good TCP examples... Throw them my way...

Just for the record... I'm not asking for a hand-out... Just the name of a UDF or better idea will suffice... Which I guess is sort of a hand out... But you get my drift... :D

Share this post


Link to post
Share on other sites



GDI+ maybe?

#include <GUIConstants.au3>
#include <GDIplus.au3>

Global Const $width=600
Global Const $height=400
GLobal $title="GDI+"

; Build your GUI here
Opt("GUIOnEventMode",1)
$hwnd=GUICreate($title,$width,$height)
GUISetOnEvent($GUI_EVENT_CLOSE,"close")
GUISetState()

; Load your GDI+ resources here:
_GDIPlus_Startup()
$graphics=_GDIPlus_GraphicsCreateFromHWND($hwnd)
$bitmap=_GDIPlus_BitmapCreateFromGraphics($width,$height,$graphics)
$backbuffer=_GDIPlus_ImageGetGraphicsContext($bitmap)



Do
    _GDIPlus_GraphicsClear($backbuffer)
    
;InetGet("somewhere.jpg","capture.jpg")
    $image=_GDIPlus_ImageLoadFromFile("capture.jpg")
    _GDIPlus_GraphicsDrawImageRect($backbuffer,$image,0,0,300,200)
    _GDIPlus_ImageDispose($image)
    
    
    _GDIPlus_GraphicsDrawImageRect($graphics,$bitmap,0,0,$width,$height)
    Sleep(10)
Until False

Broken link? PM me and I'll send you the file!

Share this post


Link to post
Share on other sites

@monoceres

Do you just live on the forums or what?? :D

Thanks for that, GDI+ code... I was just looking at something similar... :o

Thanks again!

Share this post


Link to post
Share on other sites

GUICtrlSetImage ( controlID, filename [, iconname [, icontype]] ) ???

or you want to constantly check if its been changed

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Hmm... Something is locking the script up for about 3 seconds, and then releases for just a split second... I think it's the Inetget() it's the only thing that could be holding that long I think.

nvm... I got it... :D

InetGet("captureSS35.jpg",@TempDir & "\ServerCapture.jpg",1,1)
While @InetGetActive
    Sleep(500)
WEnd

@CodyBarrett

Once I'm done, the screen is going to be split into 5 or 10 chunks, and each part of the screen will be updated if an updated checksum fails...

Once I'm done with this... It should be pretty cool... :o

Edited by BinaryBrother

Share this post


Link to post
Share on other sites

hmmm sounds interesting :D

Share this post


Link to post
Share on other sites

Thanks for pointing that little function out as well CodyBarrett. I may end up using that, as it's not as complicated as doing 10 GDI+ calls in a function... haha

Share this post


Link to post
Share on other sites

i dont know anything about GDI+ so i can't very well compare them :S i just said first thing that poped into ma head

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  
Followers 0