Ayuda Brush Ventana y Parpadeo

Ayuda Brush Ventana y Parpadeo

Postby jmartial » Wed Jan 14, 2015 4: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
jmartial
 
Posts: 458
Joined: Tue Mar 14, 2006 7:26 pm

Re: Ayuda Brush Ventana y Parpadeo

Postby Antonio Linares » Wed Jan 14, 2015 5:08 pm

Joaquín,

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

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41329
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Ayuda Brush Ventana y Parpadeo

Postby jmartial » Wed Jan 14, 2015 5: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
jmartial
 
Posts: 458
Joined: Tue Mar 14, 2006 7:26 pm

Re: Ayuda Brush Ventana y Parpadeo

Postby Antonio Linares » Wed Jan 14, 2015 5: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
User avatar
Antonio Linares
Site Admin
 
Posts: 41329
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Ayuda Brush Ventana y Parpadeo

Postby nageswaragunupudi » Thu Jan 15, 2015 7: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: Select all  Expand view

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
User avatar
nageswaragunupudi
 
Posts: 10259
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Ayuda Brush Ventana y Parpadeo (Solucionado)

Postby jmartial » Thu Jan 15, 2015 9: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
jmartial
 
Posts: 458
Joined: Tue Mar 14, 2006 7:26 pm


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 9 guests