Function FadeIn and FadeOut

Function FadeIn and FadeOut

Postby lailton.webmaster » Tue Feb 01, 2011 10:07 pm

News Function 2 Effect

Code: Select all  Expand view

#include "FiveWin.ch"

Function Main()
Local oDlg
Define Dialog oDlg Title "Teste" From 0,0 To 300,450 Pixel
// Your code here ....

Activate Dialog oDlg Centered On Init FadeIn(oDlg) Valid FadeOut(oDlg)
Return nil

Function FadeIn(oDlg)
Local nNum
oDlg:Hide()
SetTransparency( oDlg, 0 )
oDlg:Show()
For nNum := 0 TO 255
SetTransparency( oDlg, nNum )
SysRefresh()
Next nNum
Return Nil

Function FadeOut(oDlg)
Local nNum
For nNum := 255 TO 0 STEP -1
SetTransparency( oDlg, nNum )
SysRefresh()
Next nNum
Return .t.

Function SetTransparency( oDlg, nValue )
SetWindowLong( oDlg:hWnd, -20, 524288 )
SetLayeredWindowATTributes( oDlg:hWnd, nRGB(255,0,255), nValue, 2 )
Return Nil
 


:D
lailton.webmaster
 
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

Re: Function FadeIn and FadeOut

Postby Bayron » Tue Feb 01, 2011 10:19 pm

Hi Laiton,

It does not produce any effects in Windows 7 Ultimate...
=====>

Bayron Landaverry
(215)2226600 Philadelphia,PA, USA
+(502)46727275 Guatemala
MayaBuilders@gMail.com

FWH12.04||Harbour 3.2.0 (18754)||BCC6.5||UEstudio 10.10||
Windows 7 Ultimate

FiveWin, One line of code and it's done...
User avatar
Bayron
 
Posts: 815
Joined: Thu Dec 24, 2009 12:46 am
Location: Philadelphia, PA

Re: Function FadeIn and FadeOut

Postby lailton.webmaster » Tue Feb 01, 2011 10:24 pm

Yes, because your AERO Theme is enable. =(

:?
lailton.webmaster
 
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

Re: Function FadeIn and FadeOut

Postby Bayron » Tue Feb 01, 2011 10:25 pm

OK...
=====>

Bayron Landaverry
(215)2226600 Philadelphia,PA, USA
+(502)46727275 Guatemala
MayaBuilders@gMail.com

FWH12.04||Harbour 3.2.0 (18754)||BCC6.5||UEstudio 10.10||
Windows 7 Ultimate

FiveWin, One line of code and it's done...
User avatar
Bayron
 
Posts: 815
Joined: Thu Dec 24, 2009 12:46 am
Location: Philadelphia, PA

Re: Function FadeIn and FadeOut

Postby nageswaragunupudi » Wed Feb 02, 2011 7:20 am

With FWH 10.12 onwards:
Code: Select all  Expand view
#include "fivewin.ch"

function Main()

   local oDlg

   DEFINE DIALOG oDlg SIZE 600,300 PIXEL TITLE "Dialog Fade"
   oDlg:nOpacity  := 3

   ACTIVATE DIALOG oDlg CENTERED ;
      ON INIT ( oDlg:show(), dowhile( { || SysWait(.01), ( oDlg:nOpacity += 4 ) < 251 } ) ) ;
      VALID   ( dowhile( { || SysWait(.01), ( oDlg:nOpacity -= 4 ) > 3 } ), .t. )

return nil

procedure dowhile( bCond ); while Eval( bCond ); end; return
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10295
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Function FadeIn and FadeOut

Postby Bayron » Wed Feb 02, 2011 2:07 pm

Laiton's sample worked for me on FWH10.2, when I included a syswait on the code:
Code: Select all  Expand view

#include "FiveWin.ch"

Function Main()
Local oDlg
Define Dialog oDlg Title "Teste" From 0,0 To 300,450 Pixel
// Your code here ....

Activate Dialog oDlg Centered On Init FadeIn(oDlg) Valid FadeOut(oDlg)
Return nil

Function FadeIn(oDlg)
Local nNum
oDlg:Hide()
SetTransparency( oDlg, 0 )
oDlg:Show()
For nNum := 0 TO 255
SetTransparency( oDlg, nNum )
SysRefresh()
SysWait(.0004)
Next nNum
Return Nil

Function FadeOut(oDlg)
Local nNum
For nNum := 255 TO 0 STEP -1
SetTransparency( oDlg, nNum )
SysRefresh()
SysWait(.0004)
Next nNum
Return .t.

Function SetTransparency( oDlg, nValue )
SetWindowLong( oDlg:hWnd, -20, 524288 )
SetLayeredWindowATTributes( oDlg:hWnd, nRGB(255,0,255), nValue, 2 )
Return Nil
 


Windows 7 Ultimate
I don't know if the speed of the machine may influence the speed of the Fade, I don't have any slow machines to test on (FeedBack may be needed)...

Tested on a Core i5 3.33 GHz with 8GB RAM (Don't ask me why, when it seems that Windows can only manage 4GB)
=====>

Bayron Landaverry
(215)2226600 Philadelphia,PA, USA
+(502)46727275 Guatemala
MayaBuilders@gMail.com

FWH12.04||Harbour 3.2.0 (18754)||BCC6.5||UEstudio 10.10||
Windows 7 Ultimate

FiveWin, One line of code and it's done...
User avatar
Bayron
 
Posts: 815
Joined: Thu Dec 24, 2009 12:46 am
Location: Philadelphia, PA

Re: Function FadeIn and FadeOut

Postby MarcoBoschi » Wed Feb 02, 2011 2:42 pm

:P
Bravo
User avatar
MarcoBoschi
 
Posts: 1018
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: Function FadeIn and FadeOut

Postby James Bott » Wed Feb 02, 2011 4:06 pm

As I understand it, 32bit Windows can only handle 4GB RAM, but 64bit Windows can handle 8GB.

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Function FadeIn and FadeOut

Postby Bayron » Wed Feb 02, 2011 4:21 pm

James Bott wrote:As I understand it, 32bit Windows can only handle 4GB RAM, but 64bit Windows can handle 8GB.

James


You are right:
For what I see in my system, I think it uses 4 for app and the other 4 for file system.
But still useless because file copying in 64 bits is very slow, way slower than 32 bits (when copying large files||like my icon collection )
=====>

Bayron Landaverry
(215)2226600 Philadelphia,PA, USA
+(502)46727275 Guatemala
MayaBuilders@gMail.com

FWH12.04||Harbour 3.2.0 (18754)||BCC6.5||UEstudio 10.10||
Windows 7 Ultimate

FiveWin, One line of code and it's done...
User avatar
Bayron
 
Posts: 815
Joined: Thu Dec 24, 2009 12:46 am
Location: Philadelphia, PA

Re: Function FadeIn and FadeOut

Postby norberto » Wed Feb 02, 2011 4:57 pm

Hi, any 32-bit system can address more than 3.2 GB Ram, but on 64, this is limited to WIndows version, like in home editions 8GB, 16GB in home premium and 128 GB on Ultimate and Enterprise Editions.
in 64 bits, this values changes to user mode 32 bits process, page proof, kernel mode...
norberto
 
Posts: 566
Joined: Thu Aug 30, 2007 3:40 pm
Location: BR


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 51 guests