TheSwamp

Code Red => .NET => Topic started by: hobleglobsquishyworms on July 26, 2019, 04:52:05 PM

Title: Looking for ideas to stop bitmap preview
Post by: hobleglobsquishyworms on July 26, 2019, 04:52:05 PM
Looking for ideas on how to stop this preview code when the effort takes too long. Some drawings it seems to struggle with.

Code: [Select]
BlockTable bt = (BlockTable)tr.GetObject(OuterDB.BlockTableId, OpenMode.ForRead);
BlockTableRecord blk = (BlockTableRecord)tr.GetObject(bt["*Model_Space"], OpenMode.ForRead);
var imgsrc = Autodesk.AutoCAD.Windows.Data.CMLContentSearchPreviews.GetBlockTRThumbnail(blk);
var bmp = ImageSourceToGDI(imgsrc as System.Windows.Media.Imaging.BitmapSource);
pictureBox1.Image = bmp as System.Drawing.Bitmap;