AnsweredAssumed Answered

GetPreviewBitmapFile save preview bitmap with strange colors

Question asked by Amen Allah Jlili on Oct 18, 2015

I'm developing C# VSTA macro for our manufacturing department.

I'm using SldWorks.GetPreviewBitMapFile to save a bitmap preview of the selected model and show it in the picturebox as shown below:

enter image description here

The code looks fine and execute fine except for the strange colors:

bool status = swApp.GetPreviewBitmapFile(filepath, configuration, "D:\\preview.bmp"); 
pictureBox1
.ImageLocation = "D:\\Preview.bmp";
pictureBox1
.SizeMode = PictureBoxSizeMode.StretchImage;
pictureBox1
.Refresh();

Has anyone had a similar problem and what's the remedy?

Outcomes