Todd Vance

Todd Vance

  • NA
  • 160
  • 116.2k

Flickering or fading an image in or out.

Jun 17 2007 10:57 AM

I am trying to give some kind of graphic effect to an image.

Can you guys tell me a way to make a card either appear to flicker or to fade in and fade out?

I thought that that a picBox would have an Opacity attribute, but it doesnt so I couldn't play with that in a loop like I initially thought.

Then I thought I would make a loop that randomly changed the visible attribute, but it just didnt work - it just shows the card...cant figure it out

Random rnd = new Random();
answerpb.Visible =
false;

 for (int i = 0; i < 100000; i++)

{
int flickerVis = rnd.Next(0, 2);

if (flickerVis == 1)

{

answerpb.Visible = true;

}
else

answerpb.Visible = false;

}

answerpb.Visible = true;

=========

But I couldnt get that to work the way I wanted...anyone got any basic ideas?