c# - How to refresh image in Image control? -


i trying create desktop viewer. managed take single screenshot , put image control. if try repeat it, program freezes , image doesn't appear.

private void display() {     img.source = screenimage(); // returns bitmapimage }  private void button_click_2(object sender, routedeventargs e) {     while(true)     {           display();     } } 

if run display method once works, after calling more times doesn't show anything.

if trying replicate visual changes desktop in image control (make movie of desktop) instead of looping endlessly in click

what should happen if click twice (if click it)?

start timer takes snapshot every second or on background thread.

that way application remain responsive.

your current code claiming ui thread ever , why can't in application after clicking button.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -