Capturing the image using SimConnect/PDK Api

Discuss on the SimConnect SDK can be used by programmers to write add-on components for Prepar3D
Post Reply
romi
Posts: 1
Joined: Mon Aug 06, 2018 3:53 pm

Capturing the image using SimConnect/PDK Api

Post by romi »

Any Suggestion on how to capture the image using SimConnect_CaptureImage as it throws exception also there is no clarity on "szViewName" as its not matching with the parameters of SimConnect_OpenView "szName". pl suggest the right setting for the same.

aslo see the posts delow having similar problem, i don't see any closure form LM side on these issues
https://www.prepar3d.com/forum/viewtopic.php?t=125965
http://www.prepar3d.com/forum/viewtopic.php?t=125954

Also can you suggest which API of PDK to be used for saving the camera image and videos to the drive.

Also can we get the depth image form camera? Is there API for the same?

Thanks,
Romi Srivastava
obinder
Posts: 145
Joined: Sun Jun 08, 2014 9:43 am

Re: Capturing the image using SimConnect/PDK Api

Post by obinder »

Hi,

that depends on which P3D version you are using. Everything before V4.3 will probably have this problem:

https://www.prepar3d.com/forum/viewtopi ... 0&t=129429

I have implemented a workaround for this, but in V4.3 that is no longer necessary, it works as specified.

Best regards
Oliver Binder
Lorby-SI
romi srivastava
Posts: 1
Joined: Mon Aug 06, 2018 2:16 pm

Re: Capturing the image using SimConnect/PDK Api

Post by romi srivastava »

Hi,

Thanks for the reply.

Currently I am using V4.3

Here is the similar post pointing the similar problem for version 4.3 as there is some issue with correct parameters of the function.

http://www.prepar3d.com/forum/viewtopic.php?t=125954

So did you try using the function directly for v4.3 and was able to save the images successfully . In case yes can you pl suggest the correct parameter settings. Also if you have some script for storing the image can you share it.
obinder
Posts: 145
Joined: Sun Jun 08, 2014 9:43 am

Re: Capturing the image using SimConnect/PDK Api

Post by obinder »

romi srivastava wrote: Thu Aug 16, 2018 5:37 am Hi,

Thanks for the reply.

Currently I am using V4.3

Here is the similar post pointing the similar problem for version 4.3 as there is some issue with correct parameters of the function.

http://www.prepar3d.com/forum/viewtopic.php?t=125954

So did you try using the function directly for v4.3 and was able to save the images successfully . In case yes can you pl suggest the correct parameter settings. Also if you have some script for storing the image can you share it.
Hi,

no, the "problem" had nothing to do with the szViewName. Just keep them all the same and you are fine.

simconnect.OpenView("MyView", "MyView");
...
simconnect.CaptureImage("MyPicture", "C:\MyPath", 2, "MyView", false);

The bug in the pre 4.3 versions was that the szFileName and szFilePath were not working correctly. They do in 4.3.

Best regards
Oliver Binder
Lorby-SI
Post Reply