(Leadtools.Controls)

InteractiveModeCanvas Property

Show in webframe
Example 





Gets the interactive mode canvas.
Syntax
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
Copy Code  
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

See Also

Reference

ImageViewer Class
ImageViewer Members

 

 


Products | Support | Contact Us | Copyright Notices
© 2006-2014 All Rights Reserved. LEAD Technologies, Inc.