Wednesday, 15 May 2013

c# - Image magnification lagging -



c# - Image magnification lagging -

i created application allows user magnify part of background picture. main problem is, magnification field lagging can see on picture. , single threaded application. have suggestion can solve problem?

my code:

public void magnifier(point e) { magnifiedpicture.size = new size(magnifiersize, magnifiersize); magnifiedpicture.visible = true; magnifiedpicture.location = new point(e.x-magnifiersize/2, e.y-magnifiersize/2); magnifiedpicture.backgroundimage = cutthepicture(canvasimage, new rectangle(_ptoncanvas.x - 18, _ptoncanvas.y - 18, 16, 16)); magnifiedpicture.refresh(); // <-- probe, without effect }

i utilize invokepaint on mouse move event , problem solved.

invokepaint( this, new painteventargs( this.creategraphics(), this.displayrectangle ) );

c# lag magnification

No comments:

Post a Comment