So i have timer which ticks with 100ms interval. I need change image in ImageControl.
Now I have the following:
But when image updating it very blink, about 3-5 times in second.
How can I solve this problem? Help me please.
Now I have the following:
Code:
[SkinControlAttribute(20)]
protected GUIImage videoImage = null;
...
public override void onStartVideo()
{
timer = new System.Timers.Timer(100);
timer.Elapsed += new ElapsedEventHandler(_timer_Elapsed);
timer.Enabled = true; // Enable it
}
void _timer_Elapsed(object sender, ElapsedEventArgs e)
{
PixelFormat format = PixelFormat.Format32bppRgb;
Bitmap b = getFrame(format);
if(tempbm==null) return;
GUITextureManager.ReleaseTexture("[myfirstplugin:video]");
int res = GUITextureManager.LoadFromMemory(b, "[myfirstplugin:video]",0x00000000, 100, 100);
chack = !chack;
}
_videoImage.FileName = "";
_videoImage.FileName = "[myfirstplugin:video]";
}
But when image updating it very blink, about 3-5 times in second.
How can I solve this problem? Help me please.