DrawSprite WorldLocation



The method DisplayPipeline.DrawSprite(DisplayBitmap bitnap, Point3d worldLocation, float size, bool sizeInWorldSpace) is not using the Point3d in world coords, it seems to be using th x,y screen coordinates.

Here the code:

 public class DrawSpriteCommand : Command
    private readonly DisplayBitmap _bm;
    private bool _enabled;

    public DrawSpriteCommand()
        Instance = this;
        _bm = new DisplayBitmap(new System.Drawing.Bitmap(@"C:\Users\MyUser\Desktop\image.jpg"));

    public static DrawSpriteCommand Instance { get; private set; }

    public override string EnglishName => "DrawSpriteCommand";

    protected override Result RunCommand(RhinoDoc doc, RunMode mode)
        _enabled = !_enabled;
        if (_enabled) DisplayPipeline.DrawOverlay += DisplayPipeline_DrawOverlay;
        else DisplayPipeline.DrawOverlay -= DisplayPipeline_DrawOverlay;
        return Result.Success;

    private void DisplayPipeline_DrawOverlay(object sender, DrawEventArgs e)
        e.Display.DrawSprite(_bm, Point3d.Origin, 15f,false);

Here a video of the behavior:

Best Regards

(Steve Baer) #3

Thanks Enric,
I’ll take a look. I logged the bug at


Than you

(Brian Gillespie) #5

RH-43751 is fixed in the latest Service Relase Candidate


Good to know, Thanks!