public void DrawHis() { WriteableBitmap b = null; if (pc.SelectLayer != null) { b = pc.SelectLayer.getPhoto(); } if (b != null) { DrawGraphic dg = new DrawGraphic(canvasBH); DCTestLibrary.PhotoTest pt = new DCTestLibrary.PhotoTest(); List <int> bl = pt.getBrightPixNum(b); dg.DrawBrightPixNumHistogram(bl); } }
public void DrawAreaBrightness() { if (r == null) { return; } DCTestLibrary.PhotoTest pt = new DCTestLibrary.PhotoTest(); DrawGraphic dg = new DrawGraphic(DrawCanvas); WriteableBitmap sb = TargetImage.Source as WriteableBitmap; Point isp = DrawGraphic.getImagePosition(sp, TargetImage); double iw = DrawGraphic.getImageDistance(r.Width, TargetImage); double ih = DrawGraphic.getImageDistance(r.Height, TargetImage); WriteableBitmap cb = pt.getImageArea(sb, (int)isp.X, (int)isp.Y, (int)iw, (int)ih); List <int> tl = pt.getBrightPixNum(cb); dg.ForeColor = Colors.Blue; dg.DrawBrightPixNumHistogram(tl); textBlockValue.Text = (iw * ih).ToString(); }
public void DrawAreaBrightness() { if (selectRec == null) { return; } DCTestLibrary.PhotoTest pt = new DCTestLibrary.PhotoTest(); DrawGraphic dg = new DrawGraphic(DrawCanvas); WriteableBitmap sb = TargetImage.Source as WriteableBitmap; Point isp = DrawGraphic.getImagePosition(sp, TargetImage); Point iep = DrawGraphic.getImagePosition(ep, TargetImage); double iw = DrawGraphic.getImageDistance(Math.Abs(iep.X - isp.X), TargetImage); double ih = DrawGraphic.getImageDistance(Math.Abs(iep.Y - isp.Y), TargetImage); WriteableBitmap cb = pt.getImageArea(sb, (int)isp.X, (int)isp.Y, (int)iw, (int)ih); List <int> tl = pt.getBrightPixNum(cb); dg.ForeColor = Colors.Blue; dg.DrawBrightPixNumHistogram(tl); textPointCountValue.Text = (iw * ih).ToString(); List <Color> cl = pt.getImageColorList(cb); ShowBrightInfor(cl); }