void ProcPhoto_PointerPressed(object sender, PointerRoutedEventArgs e) { Image im = LChartPhoto.getImage(); im.PointerPressed -= ProcPhoto_PointerPressed; if (LChartPhoto.getPhoto() == null) { return; } Canvas dc = LChartPhoto.getDrawObjectCanvas(); if (!dc.Children.Contains(selectLine)) { dc.Children.Add(selectLine); } Point p = e.GetCurrentPoint(im).Position; Point?ip = xt.PointToPix(LChartPhoto.getPhoto(), LChartPhoto.getDrawObjectCanvas(), p, false); if (ip == null) { return; } selectLine.X1 = selectLine.X2 = p.X; selectLine.Y1 = 0; selectLine.Y2 = LChartPhoto.getDrawObjectCanvas().ActualHeight; selectLine.Stroke = new SolidColorBrush(Colors.Blue); selectLine.StrokeThickness = 3; textBlockSelectPosition.Text = ip.Value.X.ToString(); ToolTipService.SetToolTip(textBlockSelectPosition, "总宽像素:" + LChartPhoto.getPhoto().PixelWidth.ToString()); }
public Aberration() { InitializeComponent(); am = new ActionMove(this, Title); //am1 = new ActionMove(PhotoClip, image); photoTestToolbar1.setTarget(LChartPhoto); photoTestToolbar1.autoTest = TestImage; photoTestToolbar1.addPhoto = AddPhoto; photoTestToolbar1.removePhoto = RemovePhoto; dg = new DrawGraphic(LChartPhoto.getDrawObjectCanvas()); }