Hi all,

I am french reseller of Rhino and I make my first plug-in into Rhino in C#
Here is my issue :
To make thumbnails of windows files I used a lot without troubles this routine :
Bitmap myBitmap = myThumb.GetThumbnail(file.FullName);

For unknown reasons it doesn't works with Rhino V4 SDK :-(

So I try to use the follwing code : 


but I don't know how to convert a Rhino type ONWindows Bitmap in .NET Bitmap type to display the thumbnail in a PictureBox.
Any help will be appreciated.



Paris, France 


Views: 403

Replies to This Discussion

Found the soluce with a sample of Dale Fugier.

static public Bitmap Create(OnWindowsBitmap on_bitmap)
if (null == on_bitmap || on_bitmap.Width() < 1 || on_bitmap.Height() < 1)
return null;
Bitmap result = null;
result = new Bitmap(on_bitmap.Width(), on_bitmap.Height(), System.Drawing.Imaging.PixelFormat.Format24bppRgb);
if (null != result)
for (int y = 0; y < result.Height; y++)
for (int x = 0; x < result.Width; x++)
result.SetPixel(x, y, on_bitmap.Pixel(x, y));
catch (Exception exception)
System.Diagnostics.Debug.WriteLine(exception.Message + "\n" + exception.StackTrace);
return result;




© 2015   Created by McNeel Admin.   Powered by

Badges  |  Report an Issue  |  Terms of Service