Board index » delphi » Help : Creating Bitmap/Metafiles

Help : Creating Bitmap/Metafiles

Hello,

I would like to know how to create a bitmap/metafiles from a form.  If
you have any components or sample codes, kindly email a copy to me as
well as post a copy to the usenet.  I guess everyone will be happy to
hear from you.  

I will be deeply grateful for your help.

Finest Regards,
Sam

 _       __    _____    _____            
| |     / /   / ___/   / ___/ ____   ____   ____ _
| | /| / /    \__ \    \__ \ / __ \ / __ \ / __ `/
| |/ |/ /  _ ___/ / _ ___/ // /_/ // / / // /_/ /
|__/|__/  (_)____/ (_)____/ \____//_/ /_/ \__, /
                                         /____/
**************************************************
   From the desk of Song Weng Sam

   Email : son...@pacific.net.sg
   WWW   : http://home.pacific.net.sg/~songws/
   Tel   : (65)-271-7075 (0ffice)
   Pager : 9-492-4014
**************************************************

 

Re:Help : Creating Bitmap/Metafiles


son...@pacific.net.sg (Song Weng Sam) wrote:

Quote
>I would like to know how to create a bitmap/metafiles from a form.

I believe that the following method (or something like it) will
work. There might be a less convoluted way but this seems fairly
reasonable to me.

*** Begin Code Snippet here ***

Procedure TTestForm.TestDraw(Sender : TObject);
  Var
    MetaFile       : TMetaFile;
    MetaFileCanvas : TMetaFileCanvas;
  Begin
     MetaFile := TMetaFile.Create;
     MetaFileCanvas := TMetaFileCanvas.Create(MetaFile, 0);
     MetaFileCanvas.Draw(0,0, TestForm.GetFormImage);
     MetaFileCanvas.Free;
     MetaFile.Enhanced := False; {Optional}
     MetaFile.SaveToFile('test.wmf'); {Optional}
     MetaFile.Free;
  End;
__________________________________________________________________
 Dan Reagan, drea...@morganco.com                   Worcester, MA

Re:Help : Creating Bitmap/Metafiles


On Tue, 03 Sep 1996 12:42:56 GMT, drea...@morganco.com (Dan Reagan)
wrote:

~>I would like to know how to create a bitmap/metafiles from a form.
~
~I believe that the following method (or something like it) will
~work. There might be a less convoluted way but this seems fairly
~reasonable to me.
~
~Procedure TTestForm.TestDraw(Sender : TObject);
~  Var
~    MetaFile       : TMetaFile;
~    MetaFileCanvas : TMetaFileCanvas;
~  Begin
~     MetaFile := TMetaFile.Create;
~     MetaFileCanvas := TMetaFileCanvas.Create(MetaFile, 0);
~     MetaFileCanvas.Draw(0,0, TestForm.GetFormImage);
~     MetaFileCanvas.Free;
~     MetaFile.Enhanced := False; {Optional}
~     MetaFile.SaveToFile('test.wmf'); {Optional}
~     MetaFile.Free;
~  End;

Hello Dan,

Thank you for responding.  I am currently very busy with another
project.  I will try out your suggestion later.  Thanks again.

Finest Regards,
Sam

 _       __    _____    _____            
| |     / /   / ___/   / ___/ ____   ____   ____ _
| | /| / /    \__ \    \__ \ / __ \ / __ \ / __ `/
| |/ |/ /  _ ___/ / _ ___/ // /_/ // / / // /_/ /
|__/|__/  (_)____/ (_)____/ \____//_/ /_/ \__, /
                                         /____/
**************************************************
   From the desk of Song Weng Sam

   Email : son...@pacific.net.sg
   WWW   : http://home.pacific.net.sg/~songws/SAM
   Tel   : (65)-271-7075 (0ffice)
   Pager : 9-492-4014
**************************************************

Other Threads