7 Replies Latest reply on Oct 28, 2013 4:19 PM by Jacob Cordingley

    Save JPEG of non-active / non-visible part?

      Hi

       

      Does anyone know you can save a jpeg of a part without having the part open in its own window? The SaveAs4 command always seems to save a jpeg of the active window regardless of which document is specified.

       

      Thanks

        • Re: Save JPEG of non-active / non-visible part?
          Josh Brady

          You can get the preview bitmap through GetPreviewBitmap, either in SW or using the Document Manager API.  https://forum.solidworks.com/message/85484#85484

           

          As far as getting a large .jpg like from SaveAs4, I can see how that would not be possible.  SW doesn't actually generate the graphics for a document unless that document is visible.  If you really want a large SaveAs4, I believe you will have to activate the document.

          • Re: Save JPEG of non-active / non-visible part?
            Jacob Cordingley

            Public Sub pv(ByVal filePath As String )

                 Dim pic as  System.Drawing.Bitmap
                 Dim pvf As wpfPreviewFlowControl.wpfThumbnailCreator
                 pvf = New wpfPreviewFlowControl.wpfThumbnailCreator()
                 Dim size As System.Drawing.Size
                 size.Width = 200 ' SIZE OF PREVIEW
                 size.Height = 200 ' SIZE OF PREVIEW
                 pvf.DesiredSize = Size
                 pic =  pvf.GetThumbNail(filePath)

                 pic .Save(NewPath)
            End Function

            add reference C:\Program Files (x86)\SolidWorks\SolidWorks Explorer 2008\wpfPreviewFlowControl.dll

            need SolidWorks Explorer 2008

            if this is the wrong Lang. or need help add reference  let me now


            What program are you using (SW Macro,Visual Studio,Other)