Load does not refresh imgage Url´s

8 views
Skip to first unread message

Michael Muehr

unread,
May 14, 2017, 11:42:02 AM5/14/17
to CefSharp

Hi all,

I wan´t to alternate two (or more) Websites. Two links are Image Url´s from a webcam. The images are updated every 60 seconds.
I don´t get the new pictures on these links without reload after load. How can I perform a full Reload without calling Reload after the page is loaded ?

private ChromiumWebBrowser _webControl;
       
private string[] itms = { "https://www.schleswiger-stadtwerke.de/extern/webcam/Holm_SL.jpg", "http://www.google.de", "https://www.schleswiger-stadtwerke.de/extern/webcam/hafen_SL.jpg" };
       
private Timer _content = new Timer(20 * 1000);
       
private int i = 1;
       
private bool reloaded;
       
public CefWnd()
       
{
           
InitializeComponent();
           
InitWebControl();
            _webControl
.Address = itms[0];
            _content
.AutoReset = true;
            _content
.Start();
            _content
.Elapsed += (sender, args) =>
           
{
               
if (!_webControl.Dispatcher.CheckAccess())
               
{
                    _webControl
.Dispatcher.Invoke(() =>
                   
{
                       
// _webControl.Address = itms[i];
                       _webControl
.Load(itms[i]);
                   
});
               
}
               
else
               
{
                   
//_webControl.Address = itms[i];
                    _webControl
.Load(itms[i]);
               
}
                i
++;
               
if (i >= itms.Length)
                    i
= 0;
                reloaded
= false;
           
};
       
}

       
private void InitWebControl()
       
{
            _webControl
= new ChromiumWebBrowser
           
{
               
BrowserSettings = new BrowserSettings
               
{
                   
ApplicationCache = CefState.Disabled,
               
},
           
};
            _webControl
.FrameLoadEnd += (sender, args) =>
           
{
               
if (!reloaded)
               
{
                   
//_webControl.Reload(true);
                    reloaded
= true;
               
}
           
};
           
PanelzControl.Children.Add(_webControl);
       
}


Michael,..; 
Reply all
Reply to author
Forward
0 new messages