←Select platform

InteractiveModeCanvas Property

Summary

Gets the interactive mode canvas.

Syntax

C#
VB
WinRT C#
public Canvas InteractiveModeCanvas {get;} 
Public ReadOnly Property InteractiveModeCanvas As Canvas 
public Canvas InteractiveModeCanvas {get;} 
 get_InteractiveModeCanvas();  

Property Value

The interactive mode canvas.

Remarks

The current image will be drawn into the surface of this canvas. Owner draw can also be used to manually draw an image or any other shape on this canvas.

Example

WinRT C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.Controls; 
 
void InteractiveModeCanvasExample() 
{ 
   // Our custom image will have 320 by 200 pixels 
   var width = 320; 
   var height = 200; 
   // Call viewer.set_imageSize with these values, this will set a new image in the viewer with 320 by 200 pixels. The back canvas will be created 
   _viewer.ImageSize = new Size(width, height); 
 
 
   // Get the InteractiveModeCanvas canvas 
   var canvas = _viewer.InteractiveModeCanvas; 
 
   // Fill with gradient 
   // Draw the edge in yellow 
   Rectangle rect = new Rectangle 
   { 
      Width = width, 
      Height = height, 
      Fill = new SolidColorBrush(Windows.UI.Color.FromArgb(255, 0, 0, 255)), 
      Stroke = new SolidColorBrush(Windows.UI.Color.FromArgb(255, 255, 255, 0)), 
   }; 
 
   Canvas.SetLeft(rect, 0); 
   Canvas.SetTop(rect, 0); 
 
 
   TextBlock textBlock = new TextBlock(); 
   textBlock.Text = "Custom image in the viewer"; 
   textBlock.Width = width / 2; 
   textBlock.Height = height / 2; 
   textBlock.TextAlignment = TextAlignment.Center; 
   Canvas.SetLeft(textBlock, width / 4); 
   Canvas.SetTop(textBlock, height / 4); 
 
   canvas.Children.Add(rect); 
   canvas.Children.Add(textBlock); 
} 

Requirements

Target Platforms

Help Version 19.0.2017.10.28
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Controls Assembly (WinRT / WPF / iOS / OS X / Android)