I’m developing a Rhino plugin that needs to display custom bitmaps in the Rhino viewport using a display conduit. While this works as expected on Windows, the bitmaps are not showing up in the display pipeline on macOS, specifically on Apple Silicon Macs. I’ve simplified my code to eliminate other potential factors, but the issue persists.
Here’s a basic example of what I’m trying to achieve:
using Rhino.Display;
using System.Drawing; //Common
using Rhino.DocObjects;
public class CustomDisplayConduit : DisplayConduit
{
private DisplayBitmap _bitmap;
protected override void DrawForeground(DrawForegroundEventArgs e)
{
if (_bitmap == null)
{
var image = new Bitmap(@"path_to_your_image.png"); // Also tried DrawingUtilities.BitmapFromIconResource()
_bitmap = new DisplayBitmap(image);
}
if (_bitmap != null)
{
e.Display.DrawBitmap(_bitmap, 10, 10, 100, 100);
}
}
}
Details:
- OS: macOS on Apple Silicon
- Rhino Version: Rhino 8
- Direct Bitmap Loading: Initially, I attempted to load bitmaps directly using
System.Drawing.Bitmap
, which displayed fine on Windows but not on macOS. - Using Rhino’s Drawing Utilities: I switched to using
Rhino.UI.DrawingUtilities.BitmapFromIconResource
to ensure the bitmaps are loaded in a manner that’s potentially more compatible with Rhino’s ecosystem. This approach also failed to display the bitmaps on macOS. - Simplification: I removed all scaling and dynamic positioning logic to rule out complexity as the cause. The issue remained.
- Cross-Platform Verification: I’ve confirmed the code execution reaches the bitmap drawing logic on macOS through logging, suggesting the issue lies with the display or bitmap handling on macOS.
I’m looking for insights on why this issue might be occurring on macOS and how to resolve it. Any advice, or suggestions for further debugging, would be greatly appreciated.
Thank you in advance for your help!