Controllers/AbstractExportController.cs
/// <summary>
/// Export the TIM files in a TIX to common image formats.
/// </summary>
/// <param name="tix">The TIX file.</param>
/// <param name="filePath">The file path to export to.</param>
/// <param name="separate">Whether or not to separate images in the output.</param>
/// <param name="format">The image format to export to.</param>
Export the TIM files in a TIX to common image formats.
Export the TIM files in a TIX to common image formats .
public void ExportImages(TIX tix, string filePath, bool separate, ImageFormat format)
        {
            if (separate)
            {
                Log.Information($"Exporting images ({format}) in TIX to: {filePath}");
                var allTims = tix.AllTIMs;
                for (int i = 0; i < allTims.Count; i++)
                {
                    var fileName = Path.GetFileNameWithoutExtension(filePath);
                    var ext = Path.GetExtension(filePath);
                    var dir = Path.GetDirectoryName(filePath);
                    ExportImage(allTims[i], 0, Path.Combine(dir, $"{fileName}-{i}{ext}"), format);
                }
            }
            else
            {
                ITexture2D tixTex = LibLSDUtil.TIXToTexture2D(tix, headless: true, flip: false);
                ExportTexture(tixTex, filePath, format);
            }
        }
public void ExportImages ( TIX tix , string filePath , bool separate , ImageFormat format ) { if ( separate ) { Log . Information ( $" Exporting images ( { format } ) in TIX to:  { filePath } " ) ; var allTims = tix . AllTIMs ; for ( int i = 0 ; i < allTims . Count ; i ++ ) { var fileName = Path . GetFileNameWithoutExtension ( filePath ) ; var ext = Path . GetExtension ( filePath ) ; var dir = Path . GetDirectoryName ( filePath ) ; ExportImage ( allTims [ i ] , 0 , Path . Combine ( dir , $" { fileName } - { i } { ext } " ) , format ) ; } } else { ITexture2D tixTex = LibLSDUtil . TIXToTexture2D ( tix , headless : true , flip : false ) ; ExportTexture ( tixTex , filePath , format ) ; } }
Export the TIM files in a TIX to common image formats.
Export the TIM files in a TIX to common image formats .
tix
TIX
The TIX file.
The TIX file .
filePath
string
The file path to export to.
The file path to export to .
separate
bool
Whether or not to separate images in the output.
Whether or not to separate images in the output .
format
ImageFormat
The image format to export to.
The image format to export to .