Jump to content

change background in GUI using transition effect ??


piterek
 Share

Recommended Posts

Hello everyone.

I have a small problem and I can't find the answer.

I made a GUI with the controls (buttons, inputs, pictures, anothers gui windows, etc...) and picture on the background...

The problem is that I need to change bg picture to another one but in some (Smooth - Transition) effect

(like in slideshow picture - conversion of image into another image).

Of course we can't forgot about guicontrols - it must stay to position and all the time be topmost (in time transition effect too).

Ohhh I for forgot to explane why I need this transition effect.

The true is that I need to "blur" background

(but only bg - another controls must stay normal) and what is very important it must be "blur on live" so something like in prospeed FXBLUR func.

I know that it can be not easy so I maybe it will be some good idea:

- make two this same bg pictures

- to the second add blur effect in some editor photo application.

- use some transition effect function to change picture to picture.

Of course maybe I'm wrong or this is very easy to do but if some one can help me I will be so happy.

Thanks a lot and sorry for mistakes but I'm not english :)

Link to comment
Share on other sites

This can be done.

Create two GUIs, one with background, one with all other controls. Make them follow each other. There are lots of examples on the forum, I provided one below.

Then use winanimate to change the background gui

http://www.autoitscript.com/forum/index.php?showtopic=103680&st=0&p=734945&hl=winanimate&fromsearch=1&#entry734945

; *** Start added by AutoIt3Wrapper ***
#include <WindowsConstants.au3>
; *** End added by AutoIt3Wrapper ***
#AutoIt3Wrapper_Add_Constants=n
Global Const $WM_ENTERSIZEMOVE = 0x231, $WM_EXITSIZEMOVE = 0x232


$gp = GUICreate("main gui", 300, 300, 200, 200)
GUISetState()
$gs = GUICreate("dragged gui", 200, 150, 400, 400)
GUISetState()


Global $RelPos[2]
GUIRegisterMsg($WM_ENTERSIZEMOVE, "setrelpos")
GUIRegisterMsg($WM_MOVE, "followme")

While 1
    If GUIGetMsg() = -3 Then Exit
WEnd

Func followme($hW, $iM, $wp, $lp)

    If $hW <> $gp Then Return

    Local $xypos = WinGetPos($gp);use WingetPos rather than the values in $lP
    WinMove($gs, "", $xypos[0] - $RelPos[0], $xypos[1] - $RelPos[1])

EndFunc ;==>followme


;When the primary window starts moving we want to know the relative position of the secondary window.
Func SetRelPos($hW, $iM, $wp, $lp)

    If $hW <> $gp Then Return

    Local $gpp = WinGetPos($gp)
    Local $gsp = WinGetPos($gs)

    $RelPos[0] = $gpp[0] - $gsp[0]
    $RelPos[1] = $gpp[1] - $gsp[1]


EndFunc ;==>SetRelPos
Link to comment
Share on other sites

Of course I was trying make this with two GUIs -

First one was main gui and second was behind in this same place.

They haved set this same non blub background image.

- When I wanted start "blur effect" I switched this second one to be top this first

- Next I change image first one to blur image

- - And here is the problem becouse when I change image to this hiden gui going back to top for the moment

- And next I used FOR...TO... to set transparent this second one from 255 to 0

- - and everything was be a fine but gui controls in time effect going behind this gui

:::

My new/old idea is using a GUICtrlSetImage to 10 backgorund pictures with blur effect set step by step from 0 to 10

(so it will be look like animation frame to frame but problem is that bg pictures have a 1280x1024 resolution (GUI is on Full Screen)

and it's taking ~500-750ms to time to change picture so this is not look like animation. But maybe there is another way to speed up

change picture??

:::

Link to comment
Share on other sites

Do you have the gui with controls set to transparent so that all you would see without the bg is floating controls? It's hard to tell without any code but here are a few random suggestions:

  • Use two bg guis behind yur control gui
  • Set gui w/ controls to top right after setting bg to top for transition (or during)
  • Use Flash if it's handy.
Link to comment
Share on other sites

I'll kill two birds with one stone

see this example

http://www.autoitscript.com/forum/index.php?showtopic=105801&st=0&gopid=748327&#entry748327

That's what I meant by this:

Do you have the gui with controls set to transparent so that all you would see without the bg is floating controls?

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