Size of thumbnail fixed in dwg-file. It is not intresting for me to rewrite DwgPreview.arx in order to it can convert bmp-image to other format and scale it. 😞 It is more easy to do converting in C#-code. For example:
[code]
[System.Security.SuppressUnmanagedCodeSecurity]
[DllImport("dwgpreview.arx", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi ,
EntryPoint = "SaveDWGPreview")]
extern static private int SaveDWGPreview(string dwgfilename, string bmpfilename);
[CommandMethod("SavePreview")]
public void SavePreview()
{
Database db = HostApplicationServices.WorkingDatabase;
Autodesk.AutoCAD.Runtime.SystemObjects.DynamicLinker.LoadModule("DWGPreview.arx", false, false);
SaveDWGPreview(db.Filename, "C:\\dwgpreview.bmp");
System.Drawing.Image img = System.Drawing.Image.FromFile("C:\\dwgpreview.bmp");
System.Drawing.Bitmap bm = new System.Drawing.Bitmap(img,94,62);
img.Dispose(); System.IO.File.Delete("C:\\dwgpreview.bmp");
bm.Save("C:\\dwgpreview.jpg",ImageFormat.Jpeg);
bm.Dispose();
}
[/code]
Also look at this topic: http://www.autocad.ru/cgi-bin/f1/board.cgi?t=29565Fx
Message was edited by: Alexander Rivilis