Createimage giving error while saveasbitmap works
Not applicable
02-02-2018
06:08 AM
Hello.
I'm trying to create an app and I am using inventor 2017 window hidden, so to show the view of what the user is working on I find the methods "createimage" and "saveasbitmap", the best to use is createimage because it doesn't stores the image in a file, making it more eficiant, but i cann't get it to work.
I tried:
Camera cam = _inv.ActiveView.Camera;
cam.CreateImage(500,500);
But this creates an exception when running (catastrophic failure (exception from HRESULT: 0x800FFFF (E_UNEXPECTED)))
When I trie with saveasbitmap it works:
Camera cam = inv.ActiveView.Camera;
String file = "C:\\Users\\User\\Desktop\\test.jpg" ;
cam.SaveAaBitmap(file, 500,500);
Bitmap img = new Bitmap(file) ;
pictureBox1.Image = (Image)img;
Am I doing something wrong here? I have tried to find the answer by myself, but without success.
If there is another method of doing what I want using Inventor window as hide I also would like to hear
I'm trying to create an app and I am using inventor 2017 window hidden, so to show the view of what the user is working on I find the methods "createimage" and "saveasbitmap", the best to use is createimage because it doesn't stores the image in a file, making it more eficiant, but i cann't get it to work.
I tried:
Camera cam = _inv.ActiveView.Camera;
cam.CreateImage(500,500);
But this creates an exception when running (catastrophic failure (exception from HRESULT: 0x800FFFF (E_UNEXPECTED)))
When I trie with saveasbitmap it works:
Camera cam = inv.ActiveView.Camera;
String file = "C:\\Users\\User\\Desktop\\test.jpg" ;
cam.SaveAaBitmap(file, 500,500);
Bitmap img = new Bitmap(file) ;
pictureBox1.Image = (Image)img;
Am I doing something wrong here? I have tried to find the answer by myself, but without success.
If there is another method of doing what I want using Inventor window as hide I also would like to hear
Link copied