Refer to the mtk_thumbnail_generation_example_page.
using System;
namespace thumbnail_generation
{
class Program
{
static int Main(string[] args)
{
string aKey = MTKLicenseKey.Value();
if (!LicenseManager.Activate(aKey))
{
Console.WriteLine("Failed to activate Manufacturing Toolkit license.");
return 1;
}
if (args.Length != 2)
{
Console.WriteLine("Usage: " + System.Reflection.Assembly.GetExecutingAssembly().Location
+ " <input_file> <output_file>, where:");
Console.WriteLine(" <input_file> is a name of the model file to be read");
Console.WriteLine(" <output_file> is a name of the image file to be written");
return 1;
}
string aSource = args[0];
string aDest = args[1];
{
Console.WriteLine("Failed to read the file " + aSource);
return 1;
}
aWriterParameters.
SetImageWidth(750);
aWriterParameters.
SetImageHeight(500);
aWriterParameters.
SetViewIsFitAll(
true);
aWriterParameters.
SetViewBackground(aBackground);
aWriter.
SetParameters(aWriterParameters);
if (!aWriter.
WriteFile(aModel,
new UTF16String(aDest)))
{
Console.WriteLine("Failed to write the file " + aDest);
return 1;
}
Console.WriteLine("Thumbnail successfully generated: " + aDest);
return 0;
}
}
}
Provides MTK data model.
Definition Model.hxx:40
Reads STEP and native format.
Definition ModelReader.hxx:33
Defines a Unicode (UTF-16) string wrapping a standard string.
Definition UTF16String.hxx:30
Defines color background style.
Definition BackgroundStyle.hxx:45
Defines an RGBA color.
Definition Color.hxx:32
Writes an image file with graphical content of a model.
Definition ImageWriter.hxx:41
Defines parameters of the ImageWriter.
Definition ImageWriterParameters.hxx:34
Defines classes, types, enums, and functions related to topological entities and scene graph elements...
Contains classes, types, enums, and functions related to image generation.
Contains classes, namespaces, enums, types, and global functions related to Manufacturing Toolkit.
Definition LicenseManager_LicenseError.hxx:30