Beispiel #1
0
        //Matches a point on the screen with the sample match pixels
        public bool MatchSamplePoint(Point p)
        {
            bool found = false;

            foreach (Point sample in samplePointPixels)
            {
                if (sample.X == p.X && sample.Y == p.Y)
                {
                    found = true;
                }
            }

            if (!found)
            {
                return(false);
            }

            List <Point> pointsExisting = PointSets.CurveCoordinates(currentCurveName);

            List <PointMatchTriplet> pointsCreated = new List <PointMatchTriplet>();

            NuGenPointMatch.MatchSamplePoint(processedImage, pointMatchSettings,
                                             samplePointPixels, pointsExisting, pointsCreated);

            if (pointsCreated.Count < 1)
            {
                MessageBox.Show("No points successfully matched the sample point!\nSkipping the matching of sample points using arrow keys", "Point Match Error!");
            }
            else
            {
                matchSet.AddCreatedPoints(pointsCreated, p);
            }

            return(true);
        }
Beispiel #2
0
        //Highlights a point in point match mode that is a candidate for the start of
        // a point match sequence
        public void HighlightCandidateMatchPoint(Point p)
        {
            Bitmap     b      = new Bitmap(processedImage);
            BitmapData bmData = b.LockBits(new Rectangle(0, 0, b.Width, b.Height), ImageLockMode.ReadOnly, b.PixelFormat);

            if (NuGenDiscretize.ProcessedPixelIsOn(bmData, p.X, p.Y))
            {
                // pixel is on
                bool found = (samplePointPixels.Count > 0);
                if (found)
                {
                    foreach (Point sample in samplePointPixels)
                    {
                        if (sample.X == p.X && sample.Y == p.Y)
                        {
                            found = true;
                            break;
                        }

                        found = false;
                    }
                }

                if (!found)
                {
                    NuGenPointMatch.IsolateSampleMatchPoint(samplePointPixels,
                                                            bmData, pointMatchSettings,
                                                            p.X, p.Y, p.X, p.Y);
                }
            }
            else
            {
                samplePointPixels.Clear();
            }

            b.UnlockBits(bmData);
        }