private void buttonCopy_Click(object sender, RoutedEventArgs e) { if (lc.getPhoto() == null) { return; } CameraTestDesktop d = CameraTestDesktop.getDesktop(); d.addClip(lc.getPhoto()); }
public void ProcessBlue(int n) { DCTestLibrary.PhotoTest pt = new DCTestLibrary.PhotoTest(); WriteableBitmap b = p.getPhoto(); p.setPhoto(pt.BlueBitmap(b, n)); }
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 void DrawHis() { WriteableBitmap b = null; if (pc != null) { b = pc.getPhoto(); } if (b != null) { DrawGraphic dg = new DrawGraphic(canvasBH); DCTestLibrary.PhotoTest pt = new DCTestLibrary.PhotoTest(); List <int> bl = pt.getBrightPixNum(b); dg.DrawBrightPixNumHistogram(bl); } }
void TestImage() { WriteableBitmap b = LChartPhoto.getPhoto(); if (b == null) { SilverlightLFC.common.Environment.ShowMessage("没有要测试的照片"); return; } decimal d = 0m; try { d = xt.getAberration(b); } catch (Exception xe) //未知的异常 { if (xe is LFCException) //已经是系统约定的错误类型,直接往上抛 { SilverlightLFC.common.Environment.ShowMessage(xe.Message); } else { SilverlightLFC.common.Environment.ShowMessage("广角端畸变测试错误"); } } try{ double leftCirclePoint = Convert.ToDouble(xt.ProcessInfor["AberrationLCP"]); double rightCirclePoint = Convert.ToDouble(xt.ProcessInfor["AberrationRCP"]); double lv = Convert.ToDouble(xt.ProcessInfor["AberrationLVP"]); double rv = Convert.ToDouble(xt.ProcessInfor["AberrationRVP"]); leftCirclePoint = leftCirclePoint / b.PixelWidth; rightCirclePoint = rightCirclePoint / b.PixelWidth; lv = lv / b.PixelWidth; rv = rv / b.PixelWidth; dg.DrawLine(leftCirclePoint * LChartPhoto.Width, 0, leftCirclePoint * LChartPhoto.Width, LChartPhoto.Height, false, 3, new SolidColorBrush(Colors.Green)); dg.DrawLine(rightCirclePoint * LChartPhoto.Width, 0, rightCirclePoint * LChartPhoto.Width, LChartPhoto.Height, false, 3, new SolidColorBrush(Colors.Green)); dg.DrawLine(lv * LChartPhoto.Width, 0, lv * LChartPhoto.Width, LChartPhoto.Height, false, 3, new SolidColorBrush(Colors.Red)); dg.DrawLine(rv * LChartPhoto.Width, 0, rv * LChartPhoto.Width, LChartPhoto.Height, false, 3, new SolidColorBrush(Colors.Red)); textBlockAberration.Text = d.ToString(); textBlockStandardLong.Text = (rightCirclePoint - leftCirclePoint).ToString(); textBlockTrueLong.Text = (rv - lv).ToString(); } catch (Exception xe) //未知的异常 { if (xe is LFCException) //已经是系统约定的错误类型,直接往上抛 { SilverlightLFC.common.Environment.ShowMessage(xe.Message); } else { SilverlightLFC.common.Environment.ShowMessage("广角端畸变测试错误"); } } }
private void buttonCopy_Click(object sender, RoutedEventArgs e) { if (lcp == null) { SilverlightLFC.common.Environment.ShowMessage("未将按钮和测试对象关联!"); return; } ClearActiveAll(); CameraTestDesktop d = CameraTestDesktop.getDesktop(); d.addClip(lcp.getPhoto()); if (PhotoOperate != null) { PhotoOperate("Copy", lcp.getPhoto()); } }
private void currentBright_PointerMoved(object sender, PointerRoutedEventArgs e) { LChartPhoto im = sender as LChartPhoto; WriteableBitmap b = im.getPhoto(); if (b != null) { Point?p = xt.PointToPix(b, im, e.GetCurrentPoint(im.getImage()).Position, false); if (p == null) { return; } DCTestLibrary.PhotoTest pt = new DCTestLibrary.PhotoTest(); Color c = pt.GetPixel(b, Convert.ToInt32(p.Value.X), Convert.ToInt32(p.Value.Y)); float ph, ps, pb; pt.RGB2HSB(Convert.ToInt32(c.R), Convert.ToInt32(c.G), Convert.ToInt32(c.B), out ph, out ps, out pb); textBoxCurrentBright.Text = pb.ToString(); } }
private void HB_PointerPressed(object sender, PointerRoutedEventArgs e) { LChartPhoto im = sender as LChartPhoto; selectedImage = im; HB.Active(); VB.DeActive(); photoTestToolbar1.setTarget(HB); WriteableBitmap b = im.getPhoto(); if (b != null) { DCTestLibrary.PhotoTest pt = new DCTestLibrary.PhotoTest(); Point?p = xt.PointToPix(b, im, e.GetCurrentPoint(im).Position, false); if (p == null) { return; } dg.DrawBrightLines(pt.getImageGrayHLine(b, Convert.ToInt32(p.Value.Y))); } }
private void UpStep_Click(object sender, RoutedEventArgs e) { if (lc == null) { return; } if (lc.getPhoto() == null) { return; } var r = pt.MoveBitmap(lc.getPhoto(), 0, -1 * lynxUpDownMovePix.IntValue); if (r != null && r.Result != null) { lc.setPhoto(r.Result); } }
public void setTarget(LChartPhoto l) { lc = l; lynxUpDownXPix.IntValue = l.getPhoto().PixelWidth; lynxUpDownYPix.IntValue = l.getPhoto().PixelHeight; }
public WriteableBitmap getCurrentPhoto() { return(TargetControl.getPhoto()); }