hardcopy again--followup

pahsieh at usgs.gov pahsieh at usgs.gov
Tue Jan 18 15:51:50 EST 2000


> Hello, Paul
> I read your message from mailing list and think your sample program is
very
> helpful. However, when I try to run the sample program, a error message
> showed up when it call MakeBMP function.
>
> "ChoosePixelFormat fail"
>
> The program was running under windows 98 using Visual C++ 6.0 compiler. I
> tried it with VTK 2.3 and VTK 2.4 and the error is the same.
>
> Can you help me with this? Thanks in advance.
>
> Dennis

Hi Dennis:
This is due to a bug in my example--which ran OK on my NT but
failed on Win 95. The error was that I retrieved the wrong
device context. The fix is as follows. Near the end of
the MakeBMP subroutine, replace the line

     renWin->SetupMemoryRendering(width, height, renWin->GetMemoryDC());

with

     renWin->SetupMemoryRendering(width, height, GetDC(renWin->GetWindowId
()));

(Note that GetDC is a Win32 API function.) Sorry about this.

Paul




-----------------------------------------------------------------------------
This is the private VTK discussion list.  Please keep messages on-topic.
Check the FAQ at: <http://www.automatrix.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at gsao.med.ge.com>.  For help, send message body containing
"info vtkusers" to the same address.     Live long and prosper.
-----------------------------------------------------------------------------




More information about the vtkusers mailing list