Invalidates the entire surface of the control and causes the control to be redrawn.
public virtual void Invalidate()Public Overridable Sub Invalidate()public virtual void Invalidate()- (void)invalidate@Override public void invalidate()function Leadtools.Controls.ImageViewer.Invalidate()Calling Invalidate will cause the viewer to re-render the content of its canvas.
using Leadtools;using Leadtools.Codecs;using Leadtools.Controls;//method to listen to transform Change Event[TestClass]void TransformExample(){//listen to Transform Change event_viewer.TransformChanged += _Viewer_TransformChanged;}//event handler method[TestClass]void _Viewer_TransformChanged(object sender, EventArgs e){// clear imageViewer InteractiveMode canvas from all objects_viewer.InteractiveModeCanvas.Children.Clear();//Fixed RectangleLeadRectD rc1 = LeadRectDHelper.Create(20, 20, 50, 50);LeadMatrix matrix = new LeadMatrix(_viewer.Transform.M11, _viewer.Transform.M12,_viewer.Transform.M21, _viewer.Transform.M22,_viewer.Transform.OffsetX, _viewer.Transform.OffsetY);//transformed Rectangle RectangleLeadRectD rc2 = matrix.TransformRect(rc1);// add the fixed blue rectangle at 50, 50 (do not use the viewer transform)Rectangle rect = new Rectangle{Width = rc1.Width,Height = rc1.Height,Fill = new SolidColorBrush(Windows.UI.Color.FromArgb(255, 0, 0, 255)),};// Draw the red rectangle. This will be at 50, 50 as well, but will scroll and zoom// with the viewerRectangle rect2 = new Rectangle{Width = rc2.Width,Height = rc2.Height,Fill = new SolidColorBrush(Windows.UI.Color.FromArgb(255, 0, 255, 0)),};Canvas.SetLeft(rect, rc1.X);Canvas.SetTop(rect, rc1.Y);Canvas.SetLeft(rect2, rc2.X);Canvas.SetTop(rect2, rc2.Y);//add the two rectangles to interactive service canvas_viewer.InteractiveModeCanvas.Children.Add(rect);_viewer.InteractiveModeCanvas.Children.Add(rect2);}
|
Products |
Support |
Feedback: Invalidate Method - OLeadtools.Controls |
Introduction |
Help Version 19.0.2017.3.23
|

Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.