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 5.07.07 08:38

Thanks a lot! I'm trying to use the GetPicture() function, I create a CPicture1, but I don't know how to get a CBitmap from it. How can I do?

Once you get a pointer to IPictureDisp via a call to GetPicture(), you can obtain a GDI handle of the picture invoking DISPATCH_PROPERTYGET with DISPID_PICT_HANDLE (0). Just like this:

    COleVariant res; //or CComVariant, if using ATL
    DISPPARAMS noArgs = {NULL, NULL, 0, 0};
    hr = picture->Invoke(DISPID_PICT_HANDLE, IID_NULL,
        LOCALE_USER_DEFAULT, DISPATCH_PROPERTYGET,
        &noArgs, &res, NULL, NULL);
    if (SUCCEEDED(hr))
    {
        // you might want to copy HBITMAP
        // to you CBitmap instance
    }

To make code cleaner, you can use helper classes from MFC/ATL, such as CComDispatchDriver (which calls Invoke for you).

For more, please read http://msdn2.microsoft.com/en-us/library/ms680761.aspx

 


[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.