Thread View: borland.public.cppbuilder.multimedia
2 messages
2 total messages
Started by dave
Mon, 09 Sep 2002 00:36
Printing a bitmap
Author: dave
Date: Mon, 09 Sep 2002 00:36
Date: Mon, 09 Sep 2002 00:36
10 lines
1445 bytes
1445 bytes
Im having trouble with the code to print a bitmap of the form. The program is a single form. Ive tried a book called C++ builder in 21 days and the code is as follows.
Graphics::TBitmap* bitmap = new Graphics::TBitmap;
bitmap->LoadFromFile("c:\\winnt\\winnt.bmp");
Printer()->BeginDoc();
Printer()->Canvas->Draw(20, 20, bitmap);
Printer()->EndDoc();
delete bitmap;
This tries to open up the winnt.bmp file but it returns an error saying that it can't. I need to change the LoadFromFile to a screen capture of the form. Can anyone point me in the right direction....
Re: Printing a bitmap
Author: Joe C. Hecht
Date: Tue, 10 Sep 2002 00:22
Date: Tue, 10 Sep 2002 00:22
26 lines
1958 bytes
1958 bytes
Draw, and StretchDraw fail on many printers. You may also be told to use StretchDIBits(), however, StretchDIBits() requires about 2000 lines of low level graphics support code to work well, else many of your customers may receive blank or garbled pages If you do not need to deploy your applicaition, and it will only run on the printer, computer, and operating system you are using now, then use StretchDraw(). If you plan to deploy your applicaiton, or you will be using your application on other printers, computers, and other versions of Windows, then you will need to invest in a reliable printing unit. Take a look at TExcellentImagePrinter, available at: http://www.code4sale.com/joehecht Joe -- Delphi, graphics, and printing specialist available - $35/hr http://www.code4sale.com/codeit/index.htm
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads