Is there an easy way to convert the grayscale Halcon/MVtec Himage object to a c# bitmap? Sample code exists here (mvtec documentation) for a color image:
HTuple type, width, height;
HImage patras = new HImage("patras");
HImage interleaved = patras.InterleaveChannels("argb", "match", 255);
IntPtr ptr = interleaved.GetImagePointer1(out type, out width, out height);
Image img = new Bitmap(width/4, height, width,
PixelFormat.Format32bppPArgb, ptr);
pictureBox.Image = img;
But from this sample, it is not clear how I can work with grayscale images.