Piotr
September 27, 2021, 10:19am
1
I am looking for custom solution to read thumbnail (as an image) embedded in Rhino file.
Anyone can help here?
P
nathanletwory
(Nathan 'jesterKing' Letwory)
September 27, 2021, 10:49am
2
I believe you’re looking to use the File3dm.ReadPreviewImage()
method.
An example can be found here:
using Rhino;
using Rhino.Commands;
using Rhino.Input;
using Rhino.Input.Custom;
using System;
using System.Windows;
using System.Windows.Controls;
namespace examples_cs
{
public class ExtractThumbnailCommand : Command
{
public override string EnglishName { get { return "csExtractThumbnail"; } }
protected override Result RunCommand(RhinoDoc doc, RunMode mode)
{
var gf = RhinoGet.GetFileName(GetFileNameMode.OpenImage, "*.3dm", "select file", null);
if (gf == string.Empty || !System.IO.File.Exists(gf))
return Result.Cancel;
This file has been truncated. show original
Piotr
September 27, 2021, 12:30pm
3
Hi Nathan
Thanks. How do I convert it to something usable in GH?
I have zeo knowledge in terms od coding (still on my list of a thing to learn though).
dale
(Dale Fugier)
October 1, 2021, 6:13pm
4
Hi @Piotr ,
Here is a gh version of what @nathanletwory referenced.
test_extract_thumbnail.gh (8.1 KB)
– Dale
1 Like
Piotr
October 1, 2021, 7:59pm
5
Thanks a lot. I was to shy to push you