本文整理汇总了C#中Plotter类的典型用法代码示例。如果您正苦于以下问题:C# Plotter类的具体用法?C# Plotter怎么用?C# Plotter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Plotter类属于命名空间,在下文中一共展示了Plotter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1:
void IPlotterElement.OnPlotterAttached(Plotter plotter)
{
this.plotter = (Plotter2D)plotter;
this.plotter.Viewport.PropertyChanged += Viewport_PropertyChanged;
plotter.CentralGrid.Children.Add(this);
}
示例2: GetPlotterPanel
void IPlotterElement.OnPlotterAttached(Plotter plotter)
{
this.plotter = plotter;
if (Content == null) return;
var plotterPanel = GetPlotterPanel(Content);
//Plotter.SetPlotter(Content, plotter);
if (plotterPanel == PlotterPanel.MainCanvas)
{
// if all four Canvas.{Left|Right|Top|Bottom} properties are not set,
// and as we are adding by default content to MainCanvas,
// and since I like more when buttons are by default in right down corner -
// set bottom and right to 10.
var left = Canvas.GetLeft(content);
var top = Canvas.GetTop(content);
var bottom = Canvas.GetBottom(content);
var right = Canvas.GetRight(content);
if (left.IsNaN() && right.IsNaN() && bottom.IsNaN() && top.IsNaN())
{
Canvas.SetBottom(content, 10.0);
Canvas.SetRight(content, 10.0);
}
plotter.MainCanvas.Children.Add(Content);
}
}
示例3: OnPlotterAttached
protected override void OnPlotterAttached(Plotter plotter)
{
// removing restrictions previously added by base class Map, as in case of rendering to texture they
// are not relevant
Plotter.Viewport.Restrictions.Remove(base.ProportionsRestriction);
Plotter.Viewport.Restrictions.Remove(base.MaxSizeRestriction);
}
示例4: OnPlotterAttached
public void OnPlotterAttached(Plotter plotter)
{
this.plotter = (Plotter2D)plotter;
Panel panel = GetPanel(plotter);
panel.Children.Add(this);
}
示例5: OnPlotterDetaching
public void OnPlotterDetaching(Plotter plotter)
{
Panel panel = GetPanel(plotter);
panel.Children.Remove(this);
this.plotter = null;
}
示例6: AttachCore
protected override void AttachCore(PointSelector selector, Plotter plotter)
{
if (selector == null)
throw new ArgumentNullException("selector");
if (plotter == null)
throw new ArgumentNullException("plotter");
this.selector = selector;
this.plotter = (Plotter2D)plotter;
var transform = this.plotter.Transform;
// copying all markers from marker chart to InkCanvas to enable their selection
foreach (FrameworkElement marker in selector.MarkerChart.Items)
{
var xamlString = XamlWriter.Save(marker);
var markerCopy = (FrameworkElement)XamlReader.Parse(xamlString);
var x = ViewportPanel.GetX(marker);
var y = ViewportPanel.GetY(marker);
Point position = new Point(x, y);
var positionInScreen = position.ViewportToScreen(transform);
if (!marker.IsMeasureValid)
marker.Measure(new Size(Double.PositiveInfinity, Double.PositiveInfinity));
InkCanvas.SetLeft(markerCopy, positionInScreen.X - marker.Width / 2);
InkCanvas.SetTop(markerCopy, positionInScreen.Y - marker.Height / 2);
markerCopy.DataContext = marker.DataContext;
inkCanvas.Children.Add(markerCopy);
}
plotter.CentralGrid.Children.Add(inkCanvas);
}
示例7: OnPlotterAttached
public override void OnPlotterAttached(Plotter plotter)
{
base.OnPlotterAttached(plotter);
timer = new System.Windows.Threading.DispatcherTimer();
timer.Tick += new EventHandler(timer_Tick);
timer.Interval = TimeSpan.FromMilliseconds(1);
plotter.CentralGrid.MouseLeftButtonDown += new MouseButtonEventHandler(CentralGrid_MouseLeftButtonDown);
plotter.CentralGrid.MouseLeftButtonUp += new MouseButtonEventHandler(CentralGrid_MouseLeftButtonUp);
plotter.CentralGrid.MouseMove += new MouseEventHandler(CentralGrid_MouseMove);
plotter.CentralGrid.MouseWheel += new MouseWheelEventHandler(CentralGrid_MouseWheel);
plotter.CentralGrid.MouseLeave += new MouseEventHandler(CentralGrid_MouseLeave);
//plotter.CentralGrid.MouseEnter += new MouseEventHandler(CentralGrid_MouseEnter);
plotter.KeyDown += new KeyEventHandler(plotter_KeyDown);
plotter.KeyUp += new KeyEventHandler(plotter_KeyUp);
zoomingRect.Stroke = new SolidColorBrush(Colors.LightGray);
Color fillColor = new Color();
fillColor.A = 40;
fillColor.R = 0x80;
fillColor.G = 0x80;
fillColor.B = 0x80;
zoomingRect.RadiusX = 2;
zoomingRect.RadiusY = 2;
zoomingRect.Fill = new SolidColorBrush(fillColor);
}
示例8: OnPlotterAttached
public override void OnPlotterAttached(Plotter plotter)
{
Plotter = (Plotter2D)plotter;
plotter.LeftPanel.Children.Insert(0, polygon);
RebuildUI();
}
示例9: Style
void IPlotterElement.OnPlotterAttached(Plotter plotter)
{
this.plotter = (Plotter2D)plotter;
this.plotter.Viewport.PropertyChanged += Viewport_PropertyChanged;
var parent = plotter.MainGrid;
parent.MouseMove += parent_MouseMove;
parent.MouseEnter += parent_MouseEnter;
parent.MouseLeave += parent_MouseLeave;
Style lineStyle = new Style(typeof(Line));
AddBindingSetter(lineStyle, Line.StrokeProperty);
AddBindingSetter(lineStyle, Line.StrokeThicknessProperty);
leftCanvas = new Canvas();
Grid.SetRow(leftCanvas, 1);
Grid.SetColumn(leftCanvas, 0);
leftLine = new Line { Style = lineStyle, IsHitTestVisible = false };
leftCanvas.Children.Add(leftLine);
parent.Children.Add(leftCanvas);
bottomCanvas = new Canvas();
Grid.SetRow(bottomCanvas, 2);
Grid.SetColumn(bottomCanvas, 1);
bottomLine = new Line { Style = lineStyle, IsHitTestVisible = false };
bottomCanvas.Children.Add(bottomLine);
parent.Children.Add(bottomCanvas);
}
示例10: OnPlotterAttached
public override void OnPlotterAttached(Plotter plotter)
{
Plotter = (Plotter2D)plotter;
plotter.BottomPanel.Children.Add(polygon);
RebuildUI();
}
示例11: AttachCore
protected override void AttachCore(RectangleSelector selector, Plotter plotter)
{
base.AttachCore(selector, plotter);
Plotter.CentralGrid.MouseLeftButtonDown += OnMouseLeftButtonDown;
Plotter.CentralGrid.MouseLeftButtonUp += OnMouseLeftButtonUp;
Plotter.CentralGrid.MouseMove += OnMouseMove;
}
示例12: OnPlotterAttached
void IPlotterElement.OnPlotterAttached(Plotter plotter)
{
this.plotter = (Plotter2D)plotter;
HostPanel.Children.Add(this);
this.plotter.Viewport.PropertyChanged += Viewport_PropertyChanged;
OnPlotterAttached();
}
示例13: TextPainter
public TextPainter(Plotter plotter, IFont font, int sizeX, int sizeY, int spaceX)
{
this.plotter = plotter;
this.font = font;
this.sizeX = sizeX;
this.sizeY = sizeY;
this.spaceX = spaceX;
}
示例14: OnPlotterAttached
public void OnPlotterAttached(Plotter plotter)
{
this.plotter = (Plotter2D)plotter;
plotter.Dispatcher.BeginInvoke(() =>
{
plotter.Children.Add(panel);
});
}
示例15: OnPlotterDetaching
void IPlotterElement.OnPlotterDetaching(Plotter plotter)
{
OnPlotterDetaching();
this.plotter.Viewport.PropertyChanged -= Viewport_PropertyChanged;
HostPanel.Children.Remove(this);
this.plotter = null;
}