Finally, Here is the simple way to proceed bitmap as texture in c#

To process bitmap as RenderTexture

var rt = Rhino.Render.RenderTexture.NewBitmapTexture(src_bitmap, Rhino.RhinoDoc.ActiveDoc);

To process bitmap as DocObjects.Texure

var rt = Rhino.Render.RenderTexture.NewBitmapTexture(src_bitmap, Rhino.RhinoDoc.ActiveDoc);
var t = rt.SimulatedTexture(RenderTexture.TextureGeneration.Allow).Texture();
2 Likes

You should refrain from using the old-style Texture and Material in new code though. When writing code please use the RenderEnvironment, RenderMaterial and RenderTexture classes from the Rhino.Render namespace.

1 Like

I have to use legacy Texture in some cases, e.g. using Rhino.Display.

1 Like

Indeed, there are cases where you can’t get around it. In that case using the SimulatedTexture (or material or environment) is the correct approach.

1 Like