Files
ShrlAlgoToolkit/RevitLess/Program.cs
ShrlAlgo 4d35cadb56 更新
2025-07-11 09:20:23 +08:00

35 lines
1.0 KiB
C#

using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
namespace RevitLess
{
internal class Program
{
private static void Main(string[] args)
{
SaveImage(@"F:\测试\项目.rvt");
}
private static void SaveImage(string filePath)
{
var fi= new FileInfo(filePath);
Storage storage = new Storage(fi.FullName);
Image b = storage.ThumbnailImage.GetPreviewAsImage();
MessageBox.Show(storage.BasicInfo.ToString());
//Bitmap bm = new Bitmap(b.Width, b.Height, PixelFormat.Format24bppRgb);
//Graphics g = Graphics.FromImage(bm);
//g.DrawImage(b, new Point(0, 0));
//g.Dispose();
//bm.Save(Path.Combine(fi.Directory.FullName, "_Images", fi.Name.Remove(fi.Name.Length - 4) + ".png"), System.Drawing.Imaging.ImageFormat.Png);
}
}
}