This will work, but it will be erased the first time
your window is repainted.
To do this, you either need to call acdbDisplayPreviewFromDwg()
from your OnPaint() handler (ouch!), or better, cache the image
in a memory DC and bitblt to the window DC from OnPaint().
So it may be better to get the bitmap directly by calling
acdbGetPreviewBitmapFromDwg() and then display it in your
OnPaint() handler.
"Vinicius Pontes" wrote in message
news:03D2AA9B98590B8F6302180AB78C6E25@in.WebX.maYIadrTaRb...
> I'll give you a sample on how to show the preview image in a dialog
>
> -Create a dialog using ClassWizard.
> -Create a Picture object in your dialog. In the properties, set the type
to
> rectangle and the color to black.
> -Change the ID of the picture from IDC_STATIC to IDC_PREVIEW (for example)
> -Using ClassWizard, create a member variable of the type CStatic to this
> control. Name it as m_preview
> -Create a button in your dialog and put the cond below on it:
>
> CFileDialog fileDlg( TRUE, ".dwg", NULL, OFN_OVERWRITEPROMPT, "AutoCAD
> Drawings (*.dwg)|*.dwg||", this);
>
> if ( fileDlg.DoModal() == IDOK )
> {
> CString szDwg;
> szDwg = fileDlg.GetPathName();
> Adesk::UInt32 color = 0;
> acdbDisplayPreviewFromDwg(szDwg, m_preview.m_hWnd, &color);
> }
>
> -Include stdarx.h in your dialog.
>
> I tested it before post here and it worked.
>
> Vinicius
>
>
> Georg Erlenhoff escreveu nas notícias de
> mensagem:300A67A26326DB18DAF3EF47A78B39EC@in.WebX.maYIadrTaRb...
> Can't found on article 5298 the downloadfile 5298.zip
> any idear for a example ??
>
> Best regards
>
> Georg
>
>
>
>
>
>
>