private Bitmap GetViewImage(int width, int height, string namedView = null, int swStandardView = 0)
        {
            // Where swStandardView is one of the following:
            // swStandardViews_e.swIsometricView = 7
            // swStandardViews_e.swTrimetricView = 8
            // swStandardViews_e.swDimetricView = 9
            // current view = 0
            // named view = -1

            ModelView swModelView = this.swMainModel.ActiveView;
            int       errors      = 0;

            if (swModelView == null)
            {
                swApp.ActivateDoc3(modelName, false, (int)swRebuildOnActivation_e.swRebuildActiveDoc, ref errors);
            }
            swModelView            = this.swMainModel.ActiveView;
            swModelView.FrameState = (int)swWindowState_e.swWindowMaximized;

            // get current user settings
            bool prefViewDisplayHideAllTypes = swMainModel.GetUserPreferenceToggle((int)swUserPreferenceToggle_e.swViewDisplayHideAllTypes);

            // change settings for image extraction
            swMainModel.SetUserPreferenceToggle((int)swUserPreferenceToggle_e.swViewDisplayHideAllTypes, true);
            swMainModel.Extension.InsertScene("\\scenes\\01 basic scenes\\11 white kitchen.p2s");
            swModelView.DisplayMode = (int)swViewDisplayMode_e.swViewDisplayMode_HiddenLinesRemoved;
            if (namedView != null | swStandardView != 0)
            {
                // see enumeration swStandardViews_e
                swMainModel.ShowNamedView2(namedView, swStandardView);
            }
            swMainModel.ViewZoomtofit2();

            // extract the image
            string tmpFilePathName = Path.GetTempFileName();

            swMainModel.SaveBMP(tmpFilePathName, width, height);
            Bitmap bmp = (Bitmap)FromFile(tmpFilePathName);

            File.Delete(tmpFilePathName);

            // apply original user settings
            swMainModel.SetUserPreferenceToggle((int)swUserPreferenceToggle_e.swViewDisplayHideAllTypes, prefViewDisplayHideAllTypes);
            swModelView.DisplayMode = (int)swViewDisplayMode_e.swViewDisplayMode_ShadedWithEdges;

            return(bmp);
        }