c# - Paint Draw Image from another Thread? -
i read can increase drawing speed/time drawing paint event, , can draw unscaled.
so try on panel.
the problem though, image recieved in thread gui, , don´t know how give paint event.
i don´t want invoke , stuff (as incredibly slow, @ least when have used it).
the code look, this.
protected override void panel1_paint(object sender, painteventargs e, image u) { e.graphics.drawimageunscaled(u, point.empty); }
though there tried using override add add image in field, ald wanted make static, call thread. sadly t didn´t work.
but well, tried.
private void panel1_paint(object sender, painteventargs e) { // e.graphics.drawimageunscaled(u, point.empty); }
there "working" one, except can´t image it.
i tried making image variable, save image in variable, , paint it. paint never see image in it, can´t access image, guess cause it´s written thread.
//initialize private image im; //////// thread im = image.fromstream(....); ////////////7 void panel1_paint(object sender, painteventargs e) { if(im !=null) e.graphics.drawimageunscaled(im, point.empty); }
this how tried, , failed.
Comments
Post a Comment