Jump to content

image in gui in a square


tomashen
 Share

Recommended Posts

Check the help file for GUICtrlCreatePic and try example 2.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Right. The picture GUI (gui#2) is a child of the main GUI (gui#1)

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Did you move the example script to another directory? The image has a relative path so you either have to change the path or copy the image as well.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

no path was changed ... but um never mind i fixed it.. my mistake was.. taht i mistakenly did

GUICreate("", 0,1,2,3)  ;i put 0 as 0 ;1 as 0; and 2/3 i put as the size

i did the coords of GUICreate as for GUICtrlCreate... :D btu no w i fixed it..

EDIT:

um also is there a way to get rid of flashing?

Edited by tomashen

Proud of AutoIt Proud of MySelf :)

Link to comment
Share on other sites

When I run the example script I get no flashing on Windows 7 64bit.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

no no no i mean ..

umm here

$GUI=GUICreate("TEST...", 800, 600)

$pic = GUICreate("", 400, 300, 0, 0, $WS_POPUP, $WS_EX_MDICHILD, $gui)
$img = GUICtrlCreatePic("Dataimg.JPG", -1, -1, 800, 600)


;===================================================================


guisetstate(@SW_SHOW, $GUI)
GUISetState(@SW_SHOW, $pic)
while 1
    Switch GUIGetMsg()
    Case $GUI_EVENT_CLOSe
        Exit 1
    EndSwitch
controls()
WEnd

Func controls()

    If _IsPressed("25") then
        If _IsPressed($SPEED_WALK_PRESS) Then
            move($NRML_MOVE)
            GUICtrlSetPos($img, $CHAR2[0]-1, $CHAR2[1])
        Else
            move($FLY_MOVE)
            GUICtrlSetPos($img, $CHAR2[0]-1, $CHAR2[1])
        EndIf
        map(1,1)
    EndIf
    If _IsPressed("26") Then
        If _IsPressed($SPEED_WALK_PRESS) Then
            move(10)
            GUICtrlSetPos($img, $CHAR2[0], $CHAR2[1]-1)
        Else
            move(50)
            GUICtrlSetPos($img, $CHAR2[0], $CHAR2[1]-1)
        EndIf
        map(1,1)
    EndIf
    If _IsPressed("27") Then
        if _IsPressed($SPEED_WALK_PRESS) Then
            move(10)
            GUICtrlSetPos($img, $CHAR2[0]+1, $CHAR2[1])
        Else
            move(50)
            GUICtrlSetPos($img, $CHAR2[0]+1, $CHAR2[1])
        EndIf
        map(1,1)
    EndIf
    If _IsPressed("28") Then
        If _IsPressed($SPEED_WALK_PRESS) Then
            move(10)
            GUICtrlSetPos($img, $CHAR2[0], $CHAR2[1]+1)
        Else
            move(50)
            GUICtrlSetPos($img, $CHAR2[0], $CHAR2[1]+1)
        EndIf
        map(1,1)
    EndIf
    Return
EndFunc

when im moving the image it flashes when being moved :/

Proud of AutoIt Proud of MySelf :)

Link to comment
Share on other sites

I can't test your script because a lot of stuff is missing.

But I think you get the flashing because of _IsPressed. This function returns true for quite some time. I tested with the following script and got about 64 milliseconds (press Tab to start the measurement and ESC to exit the script).

So if your loop needs less time to process you will run the code for a key press multiple times.

#include <Misc.au3>
$hTime = TimerInit()
While 1
    If _IsPressed("09") Then ConsoleWrite(TimerDiff($hTime) & @CRLF)  ; Tab
    If _IsPressed("1B") Then Exit         ; ESC to exit the script
WEnd

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

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