Also, ich versuche, einen Kreis zu zeichnen, nachdem ich einen Kreis mit dem SimpleShapeChecker() aus der Accord.net tragbaren Bibliothek mit diesem Code gefunden:Wie zeichnet man einen Kreis, nachdem ein Kreis mit SimpleShapeChecker erkannt wurde? (Accord.net Portable)
// locate objects using blob counter
BlobCounter blobCounter = new BlobCounter();
blobCounter.ProcessImage(bitmap);
Blob[] blobs = blobCounter.GetObjectsInformation();
// create Graphics object to draw on the image and a pen
Graphics g = Graphics.FromImage(bitmap);
Pen redPen = new Pen(Color.Red, 2);
// check each object and draw circle around objects, which
// are recognized as circles
for (int i = 0, n = blobs.Length; i < n; i++)
{
List<IntPoint> edgePoints = blobCounter.GetBlobsEdgePoints(blobs[i]);
Point center;
float radius;
if (shapeChecker.IsCircle(edgePoints, out center, out radius))
{
g.DrawEllipse(redPen,
(int) (center.X - radius),
(int) (center.Y - radius),
(int) (radius * 2),
(int) (radius * 2));
}
}
redPen.Dispose();
g.Dispose();
jedoch sowohl das System .Drawing.Graphics und System.Drawing.Pen zeigt einen Fehler:
"inaccessible due to its protection level"
Deshalb kann ich nicht wirklich etwas tun, nachdem ich einen Kreis gefunden habe. Gibt es einen Workaround dafür?
Ich sehe. Vielen Dank. Ich habe es funktioniert. Ich habe WriteableBitmapEx verwendet, um einen Kreis zu zeichnen. –