Animazione con bitmap

Moderator: Enrico Maria Giordano

Animazione con bitmap

Postby Pier Luigi » Thu Aug 16, 2007 8:15 am

In un programma ho inserito una breve animazione utilizzando una serie di bitmap unitamente alla funzione SetBmp. Funziona egregiamente, ma durante l'animazione, l'immagine "sfarfalla", "lampeggia" (non so come definirla). E' possibile eliminare questo fenomeno?

Grazie.
Pier Luigi
User avatar
Pier Luigi
 
Posts: 58
Joined: Fri Oct 07, 2005 6:30 am
Location: Rome - Italy

Postby Antonio Linares » Thu Aug 16, 2007 8:23 am

Pier,

Are you using XP themes ? Are the images painted transparently ?
regards, saludos

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

Postby Pier Luigi » Thu Aug 16, 2007 8:32 am

Yes, I use XP themes and the image is painted transparently.

Pier Luigi
User avatar
Pier Luigi
 
Posts: 58
Joined: Fri Oct 07, 2005 6:30 am
Location: Rome - Italy

Postby Antonio Linares » Thu Aug 16, 2007 8:50 am

Pier,

I guess that you mean "flickering". If yes, then Class TBitmap already uses "double buffer" painting technique to avoid the flickering.

Please check if your source\classes\bitmap.prg file contains these lines:
Code: Select all  Expand view
METHOD Paint() CLASS TBitmap

   local aInfo := ::DispBegin()
   ...
regards, saludos

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

Re: Animazione con bitmap

Postby Enrico Maria Giordano » Thu Aug 16, 2007 9:46 am

Con un esempio minimale del problema sarebbe più facile aiutarti.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Antonio Linares » Thu Aug 16, 2007 11:37 am

Dear Enrico,

Your mail server has blocked ours again:
<e.m.giordano@alice.it>:
85.33.2.53 does not like recipient.
Remote host said: 550 5.7.1 213.149.226.3 has been blocked by abuseat
Giving up on 85.33.2.53.

so the forums can't notify you again. You could get a new gmail account
regards, saludos

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

Postby Pier Luigi » Thu Aug 16, 2007 5:00 pm

Antonio,

It is ok! I used one old version of Bitmap class :oops:

One question:

I would want the resize of a bitmap.
Can I use the function ::DispBegin() with WndSetSize() to avoid the "flickering" ?

For example:

aInfo := oBmp:DispBegin()
WndSetSize( oBmp:hWnd, nWidth, nHeight, .t. )
...

Regards
Pier Luigi
User avatar
Pier Luigi
 
Posts: 58
Joined: Fri Oct 07, 2005 6:30 am
Location: Rome - Italy

Postby Antonio Linares » Thu Aug 16, 2007 5:08 pm

Pier,

The double buffer painting is only required at the Paint() method. If you resize the control, it should not flick
regards, saludos

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


Return to All products support

Who is online

Users browsing this forum: No registered users and 7 guests