Board index » delphi » Flicker in changing the color of an image/component

Flicker in changing the color of an image/component

I am working on an application in which I would like to change the
color of a specified area in the form every 75 ms.  I have done this
by writing an ellipse on the form's canvas, but also by creating two
panels which visibility I switch.  In all  situations (and I also
tried most of the flicker reduction suggestions from efg's website), I
see a flicker (and not the one I intend to create).
   The flicker seems to be created because the switching of color
sometimes happens in the middle of displaying the e.g. ellipse.  This
gives for only one frame an ellipse with a line in the middle because
it exists of two colors.  
  Assuming this is what is happening.  Does anyone know of any methods
of controlling in which part of a frame the canvas' contents is
updated?

Any help, even if you have some suggestions on what keywords to search
the internet at, would be highly appreciated.

Thanks,

Gerard

 

Re:Flicker in changing the color of an image/component


Gerard

I had flickering in my screens too.  I was not using any graphics though.

I did manange to remove it.  What I did was create a fresh Form and
manually copy everthing from my old form to the new one. Once I did that,
the flickering went away.  I'm not sure exactly why, but it solved my
flickering problem

Hope this helps you too

--
Posted via CNET Help.com
http://www.help.com/

Re:Flicker in changing the color of an image/component


Searching the web, I found now that the splitting an image in two, is
called "tearing".  The code that I found to wait till a vertical
retrace of the display is in process is given in C (?) as the
following:

while(!(inp(0x3da)&0x08));

It means that the Input Status Register, which is one of the the video
card's General Registers is tested for bit 3 to be set.  Could anyone
help me out by translating this into Delphi language?

Thanks,

Gerard

Re:Flicker in changing the color of an image/component


Hi,

You should not use the graphics controller directly, because NT and
Win2000 will not let you access the graphics controller directly unless
you write a driver. Futher more you will "hang up" the system when
you wait for a vertical retrace (e.g untill the VR is in progress).
If you need to synchronize your output with vertical retrace you should
use DirectX (DirectDraw).

As I recall Delphi has removed the "Port" keyword, but the translation
would look like this (pascal version) :

procedure WaitVR;
begin
  while (Port[$3da] and $8) = 0 do;
end;

Michael.

Quote
"Joyce/Gerard" <de...@accessone.com> wrote in message

news:39d00d7a.43043402@news.accessone.com...
Quote
> Searching the web, I found now that the splitting an image in two, is
> called "tearing".  The code that I found to wait till a vertical
> retrace of the display is in process is given in C (?) as the
> following:

> while(!(inp(0x3da)&0x08));

> It means that the Input Status Register, which is one of the the video
> card's General Registers is tested for bit 3 to be set.  Could anyone
> help me out by translating this into Delphi language?

> Thanks,

> Gerard

Other Threads