Create a all black image and Cvb.ImageDrawer.FillCircle

This is basically the same issue as with the DrawCircle method you had:

https://forum.commonvisionblox.com/t/stemmer-cvb-imagedrawer-drawcircle/1032/2?u=parsd

Here is the workaround for the FillCircle method:

public static class ImageDrawer
  {
    private const int AntiAliasOff = 0;
    private const int NormalDrawMode = 0;

    public static void FillCircle(Image image, RgbColor color, int centerX, int centerY, int radius)
    {
      FillCircle(image, new double[] { color.R, color.G, color.B }, centerX, centerY, radius);
    }

    public static void FillCircle(Image image, double[] intensity, int centerX, int centerY, int radius)
    {
      if (image == null)
        throw new ArgumentNullException(nameof(image));
      if (image.Planes.Count != intensity.Length)
        throw new ArgumentException("Intensity array length differs in regard to the number of planes", nameof(intensity));
      for (int i = 0; i < intensity.Length; ++i)
        FillCircle(image.Planes[i], intensity[i], centerX, centerY, radius);
    }

    public static void FillCircle(ImagePlane plane, double intensity, int centerX, int centerY, int radius)
    {
      int result = FillCircleInImage(plane.Parent.Handle, plane.Plane, centerX, centerY, radius, intensity, NormalDrawMode, AntiAliasOff);
      if (result < 0)
        throw CvbException.FromCvbResult(result);
    }

    [DllImport("CVCImg")]
    private static extern int FillCircleInImage(IntPtr image, int index, int centerX, int centerY, int radius, double intensity, int drawMode, int antiAliasMode);
  }
2 Likes