ParallelGraphics Forums
SDK
You are here: [Forums]::[General]::[SDK]

Registration 
Registration
Forgot your password?

Help 
Help
Support

Quick search 

Subscribe to newsletters 

Install Cortona VRML Client for FREE!
Outline 3D
Try RobinZone!
email:  password:
   General - SDK

Subject: Re: [snapshot] Taking snapshot through SDK
Sender: nalex@parallelgraphics.com 6.07.07 06:37
At the moment my app takes the snapshot only through a GDI device (without using the CortSDK), and that works properly, but I have to integrate this feature with Cortona SDK and I invoked GetBuffer(&pBuff, &nBytes, &nWidth, &nHeight, &nBPP) from I3DViewService4 and I tried to convert it to a HBITMAP. For some reasons, I get a black bitmap instead of the real snapshot. This code is here: http://rafb.net/p/fO9rla29.html

At a first glance, the code is quite OK, including commented out section with SetDIBitsToDevice. Provided that BITMAPINFO wrapped by CBitmapInfo is filled properly, there is no visible inconsistencies.
You can see the "pBuff" contents to be sure that it contains a valid data, not just 0x00s or 0xFFs.

Actually my task is very tricky. I'd like to generate jpg snapshots from every viewpoint, in a separate thread. First of all, is it possible? Can you recommend some general approach to this problem? It seems very hard to me, I don't know where to start.

No and again, no. Due to appartment model restrictions, you should perform all calls to Cortona in the same thread that created Cortona control. Do not call Cortona in a other threads.
Though you can copy all the data returned by I3DViewService4::GetBuffer to the memory block allocated by your application and then create the bitmap and pack it to JPEG in a separate thread.

 


[snapshot] Taking snapshot through SDK / Andrea B / 4.07.07 07:07
     Re: [snapshot] Taking snapshot through SDK / nalex@parallelgraphics.com / 4.07.07 07:32
         Re: [snapshot] Taking snapshot through SDK / Andrea B / 5.07.07 07:48
             Re: [snapshot] Taking snapshot through SDK / nalex@parallelgraphics.com / 5.07.07 08:38
                 Re: [snapshot] Taking snapshot through SDK / Andrea B / 6.07.07 05:26
                     Re: [snapshot] Taking snapshot through SDK / nalex@parallelgraphics.com / 6.07.07 06:42
                     Re: [snapshot] Taking snapshot through SDK / nalex@parallelgraphics.com / 6.07.07 06:37

Messages in thread: 7


© 1998-2007 ParallelGraphics. All rights reserved. Terms of use.