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); } } }