FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Ayuda Brush Ventana y Parpadeo
Posts: 458
Joined: Tue Mar 14, 2006 07:26 PM
Ayuda Brush Ventana y Parpadeo
Posted: Wed Jan 14, 2015 04:55 PM

Hola,

Necesitaría poner una ventana maximizada con una imágen de fondo, hasta ahí bien, creo un brush con la imágen y la asigno.
Pero después de unos segundos necesito cambiar esa imágen de fondo por otra, la cambio asignando otro brush. Pero se nota el PARPADEO.

¿Conocéis alguna forma de cambiar una imágen de fondo de una ventana, por otra sin que se note ningún parpadeo?

Un Saludo,

Joaquín Martínez
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Ayuda Brush Ventana y Parpadeo
Posted: Wed Jan 14, 2015 05:08 PM

Joaquín,

Puedes mostrar el código para ver como lo haces ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 458
Joined: Tue Mar 14, 2006 07:26 PM
Re: Ayuda Brush Ventana y Parpadeo
Posted: Wed Jan 14, 2015 05:22 PM

Antonio,

El código es muy largo, pero si te sirve, uso esto antes del Activate:

oBrush := TBrush():new( ,,,, ResizeBmp( ::oBmpFondo:hBitmap, ::nAnchoPant,::nAltoPant, .T. ) )
::oBmpFondo:End()
::oWnd:setBrush( oBrush )
oBrush:end()

Luego para cambiar, otra brush definida antes:

::oWnd:setBrush( oBrush2 )

Al cambiar a éste segundo, se nota el parpadeo.

Un Saludo,

Joaquín Martínez
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Ayuda Brush Ventana y Parpadeo
Posted: Wed Jan 14, 2015 05:38 PM

Joaquin,

Prueba a usar el pintado a doble buffer:

local aInfo := ::oWnd:DispBegin()

::oWnd:SetBrush( oBrush2 )

::oWnd:DispEnd( aInfo )

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Ayuda Brush Ventana y Parpadeo
Posted: Thu Jan 15, 2015 07:24 AM
jmartial wrote:Hola,

Necesitaría poner una ventana maximizada con una imágen de fondo, hasta ahí bien, creo un brush con la imágen y la asigno.
Pero después de unos segundos necesito cambiar esa imágen de fondo por otra, la cambio asignando otro brush. Pero se nota el PARPADEO.

¿Conocéis alguna forma de cambiar una imágen de fondo de una ventana, por otra sin que se note ningún parpadeo?


You do not need to do any coding. Define a brush with your image with style STRETCH or RESIZE.
Example:

Code (fw): Select all Collapse
DEFINE BRUSH oBrush FILE <your image file> STRETCH
DEFINE WINDOW oWnd
oWnd:SetBrush( oBrush )
ACTIVATE WINDOW oWnd
RELEASE BRUSH oBrush

Now the whenever the window is resized, the brush automatically gets resized (stretched) to fit the client area of the window. The brush object automatically handles the resizing. Resizing is smooth without any flickers.

For Image file, you can use bmp, jpg, png or any other image format.

You do not have to write any code to keep resizing the brush. We recommend you not to.

Brush object supports two kinds of resizing:
1) STRETCH: The entire image is resized to the width and height of the client area of the window. This can distort the image. Particularly if the image contains a photo the faces may get too widely or narrowly streched.
2) RESIZE: Image will be resized retaining the proportion of width/height of the original image to the extent that the window is fully covered with the image.

Eg: DEFINE BRUSH oBrush FILE "myphoto.jpg" RESIZE

You can also use Brush object for Gradients.

DEFINE BRUSH oBrush GRADIENT aGradient VERTICAL (or) HORIZONTAL.
This brush also gets resized with the window automatically.

These resizable brushes were first introduced in FWH 11.05.
Regards



G. N. Rao.

Hyderabad, India
Posts: 458
Joined: Tue Mar 14, 2006 07:26 PM
Re: Ayuda Brush Ventana y Parpadeo (Solucionado)
Posted: Thu Jan 15, 2015 09:03 AM

Muchas Gracias Rao,

DEFINE BRUSH oBrush FILE <your image file> STRETCH

Funcionó perfecto y sin parpadeos!!!!

Thank you, very much.

Un Saludo,

Joaquín Martínez

Continue the discussion