Sign in to follow this  
Followers 0
sisu

how to put a picture fundealul a prigram?

7 posts in this topic

#1 ·  Posted (edited)

sal how to put a picture in the program ....

adik not be gray and be a picture ms

#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here

#include <GUIConstants.au3>

#include <Misc.au3>

$iChecker = GUICreate("get avatar by toxicvn", 211, 135, 221, 209)

$on_off=GUICtrlCreatePic("",190,73,20,20)

$ID = GUICtrlCreateInput("", 16, 72, 169, 21)

$Check = GUICtrlCreateButton("Get !", 16, 104, 65, 25, 0)

$Exit = GUICtrlCreateButton("Exit", 112, 104, 73, 25, 0)

GUICtrlCreateLabel("Enter the Yahoo ! ID here :", 32, 53, 131, 17)

GUISetState(@SW_SHOW)

While 1

$nMsg = GUIGetMsg()

Select

Case $nMsg=$Check or _IsPressed("0D")

If GuiCtrlRead($ID)="" Then

MsgBox(0,"Error !", "Please enter an ID !")

Else

InetGet("http://img.msg.yahoo.com/avatar.php?yids=" & GuiCtrlRead($ID),"avatar.JPG", 1)

Exitloop

EndIf

EndSelect

WEnd

GUICreate("My GUI picture", 350, 300, -1, -1) ; will create a dialog box that when displayed is centerGUISetBkColor(0xE0FFFF)

$n = GUICtrlCreatePic(@scriptdir & "\avatar.gif", 50, 50, 200, 50)

GUISetState()

; Run the GUI until the dialog is closed

While 1

$msg2 = GUIGetMsg()

If $msg2 = $GUI_EVENT_CLOSE Then ExitLoop

WEnd

Edited by sisu

Share this post


Link to post
Share on other sites



I believe he wants to be able to put a gif in his script


Giggity

Share this post


Link to post
Share on other sites

Oh.... that's...... that's..... understandable. :lmao:

Proud to be 17900 :)

that's funny

@sisu

you are downloading avatar.JPG and than you have GUICtrlCreatePic(@scriptdir & "\avatar.gif", ...


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

Cand ceri ceva fa-o in engleza, ca sa inteleaga toti.

Am scris codul asta, poate te ajuta:

#include <GDIPlus.au3>
#include <WinAPI.au3>

Global $YM_GUI,$YM_GRAPHIC,$YM_IMAGE=""
_GDIPlus_Startup()
$YM_GUI = GUICreate("Y! Get Avatar by toxicvn", 150, 181, -1,-1, 0x16C80000,0x00000181)
$YM_INFO = GUICtrlCreateLabel("Enter the Yahoo ! ID here :", 5, 106, 140, 20)
$YM_ID = GUICtrlCreateInput("", 5, 131, 140, 20,BitOR(0x0010,0x01))
$YM_CHECK = GUICtrlCreateButton("Get !", 5, 156, 60, 20)
$YM_EXIT = GUICtrlCreateButton("Exit", 80,156,60,20)
$YM_GRAPHIC = _GDIPlus_GraphicsCreateFromHWND($YM_GUI)
GUISetState(@SW_SHOW,$YM_GUI)
GUIRegisterMsg(0x000F, "MY_PAINT")

While 1
    $MSG = GUIGetMsg()
    If $MSG = $YM_CHECK Then
        If $YM_IMAGE <> "" Then _GDIPlus_ImageDispose($YM_IMAGE)
        $ID = GUICtrlRead($YM_ID)
        InetGet("http://img.msg.yahoo.com/avatar.php?yids=" & $ID,@TempDir & "\avatar.png",0,1)
        Do
            Sleep(20)
        Until @InetGetActive = 0
        $YM_IMAGE = _GDIPlus_ImageLoadFromFile(@TempDir & "\avatar.png")
        _GDIPlus_GraphicsDrawImage($YM_GRAPHIC,$YM_IMAGE,27,5)
    ElseIf $MSG = $YM_EXIT Or $MSG = -3 Then
        _GDIPlus_ImageDispose($YM_IMAGE)
        _GDIPlus_GraphicsDispose($YM_GRAPHIC)
        _GDIPlus_Shutdown()
        Exit
    EndIf
    Sleep(20)
WEnd

Func MY_PAINT($hWnd, $Msg, $wParam, $lParam)
    _WinAPI_RedrawWindow($YM_GUI,0,0,0x0100)
    _GDIPlus_GraphicsDrawImage($YM_GRAPHIC,$YM_IMAGE,27,5)
    _WinAPI_RedrawWindow($YM_GUI,0,0,0x0008)
    Return 'GUI_RUNDEFMSG'
EndFunc

When the words fail... music speaks

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