Saving image from Picturebox...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi guys I am stuck on a strange one. I get an image from the camera object using apprentice and puting it into a Picturebox. But when I try and save the image using the standard Picturebox.image.save method I get an error. Can anyone shed some light on this for me?
Private Sub Button3_Click(sender As System.Object, e As System.EventArgs) Handles Button3.Click
Dim oApprentice As New Inventor.ApprenticeServerComponent
Dim Doc As Inventor.ApprenticeServerDocument
Doc = oApprentice.Open(oApp.ActiveDocument.FullFileName) 'oApp is defined elsewhere.
' Create a client view for the document, passing in the hWnd for a picture box.
Dim clientView As Inventor.ClientView = Doc.ClientViews.Add(PictureBox1.Handle)
' Get the camera that’s associated with the client view.
Dim cam As Inventor.Camera = clientView.Camera
' Define the camera.
cam.ViewOrientationType = ViewOrientationTypeEnum.kIsoTopLeftViewOrientation
cam.Perspective = False
cam.Fit()
cam.Apply()
clientView.Documen()
' Drawing the current view.
clientView.Update(False)
Dim oImage As Drawing.Image
oImage = PictureBox1.Image
oImage.Save("c:\temp\imagefile.jpg", System.Drawing.Imaging.ImageFormat.Jpeg)
End Sub