Sign in to follow this  
Followers 0
John117

flip pic horizontal on load?

6 posts in this topic

#1 ·  Posted (edited)

Hey, I have about 50 pics that load into a gui at different times and a lot of code that determines which loads and when. There are times (as often as not) when the images will need to be horizontally flipped. Is it possible to do this with out naming all my pictures with a R, L ending?

I would really like to not have to double code :)

A modified help example: -suppose then the mouse changes directions, I would like to see the other side (yes I know its not really the other side, just the one side reversed)

;----- example 2
#include <GUIConstants.au3>

$gui=GUICreate("test transparentpic", 200, 100)
$pic=GUICreate("", 126, 38, 10, 10,$WS_POPUP,BitOr($WS_EX_LAYERED,$WS_EX_MDICHILD),$gui)
GUICtrlCreatePic(@Systemdir & "\oobe\images\mouse.gif",0,0, 0,0)

GUISetState(@SW_SHOW,$pic)
GUISetState(@SW_SHOW,$gui)

HotKeySet("{ESC}", "main")
HotKeySet("{LEFT}", "left")
HotKeySet("{RIGHT}", "right")
HotKeySet("{DOWN}", "down")
HotKeySet("{UP}", "up")
$picPos = WinGetPos($pic)
$guiPos = WinGetPos($gui)

do
    $msg = GUIGetMsg()
until $msg = $GUI_EVENT_CLOSE
Exit

Func main()
    $guiPos = WinGetPos($gui)
    WinMove($gui,"",$guiPos[0]+10,$guiPos[1]+10)
EndFunc

Func left ()
    $picPos = WinGetPos($pic)
    WinMove($pic,"",$picPos[0]-10,$picPos[1])
EndFunc

Func right()
    $picPos = WinGetPos($pic)
    WinMove($pic,"",$picPos[0]+10,$picPos[1])
EndFunc

Func down()
    $picPos = WinGetPos($pic)
    WinMove($pic,"",$picPos[0],$picPos[1]+10)
EndFunc

Func up()
    $picPos = WinGetPos($pic)
    WinMove($pic,"",$picPos[0],$picPos[1]-10)
EndFunc
Edited by Hatcheda

Share this post


Link to post
Share on other sites



Not a single reply?

Share this post


Link to post
Share on other sites

Not a single reply?

I probably don't understand what you're asking, but why not just have a button for flipping the picture horizontally?

If you mean that you don't want to have to keep doing that everytime you load the same picture then you could make an ini file and write the file names of all the pictures which have been flipped, so every time you load a picture, if it's in the ini file then flip it. Of course you will have to keep track of exactly what has happened so that you can decide you don't want a picture flipped any more.


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Hey, thanks for the reply!

Really all I am trying to do is find any form of code that will flip a picture horizontally.

I can control when it will flip and what tells it do that function

what I can not find is if it is possible to load or set a picture flipped horizontally.

Ex (what Im doing now) -I have pic 1.gif and pic 1R.gif

$PicFile1 = "Pic 1"
$PicFilter = "gif"
$PicFileH = "R"

$PicCtrl1 = GUICtrlCreatePic($PicDir & $PicFile1 & $PicFilter, 0, 0, 10, 10)
;Then when I want to change
GUICtrlSetImage($PicCtrl1, $PicDir & "\" & $PicFile1 & $PicFileH & $PicFilter)oÝ÷ Øw«{l­#
.Ùbëhv!j÷©Í`ú'&®¶­sbb33cµ4fÆSÒgV÷Cµ2ævbgV÷C°¢b33cµ47G&ÃÒuT7G&Ä7&VFU2b33cµ4F"fײb33cµ4fÆS£µFVâvVâvçBFò6ævP¤uT7G&Å6WDÖvRb33cµ47G&ÃÂb33cµ4F"fײgV÷C²b3#²gV÷C²fײb33cµ4fÆSÂfÆVB
Edited by Hatcheda

Share this post


Link to post
Share on other sites

@ptrex Thanks for the homework! :)

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