GetPageAsMetafile Method

[Top]  [Chapter]  [Previous]  [Next]

Declaration

int GetPageAsMetafile(int PageNr,int Options);

Description

Creates a meta file from a certain page and returns the handle.

To create a file use SavePageAsMetafile.

 

Parameters:

PageNr :        The number of the page to be saved. The first is 0.

Options:        a bit field:

4: display a frame for the page margins

8: optimized for PDF export. We recommend to always set this bit!

16: also print selection marker

32: do not print watermarks

64: do not print header and footer

128: do not print images

256: print table grid lines.

512: Export embedded meta-files as bitmaps

Returns

The handle to an enhanced metafile. If an error happens the return value is 0. The handle must be freed by the caller.

 

This C# function can be used to load a metafile from a handle into picture box:

 

private void LoadInImage(System.Windows.Forms.PictureBox PictureBox, int MetaHandle)

{

 if (MetaHandle!=0)

 {

  Metafile aMetafile=new Metafile(new IntPtr(MetaHandle), true);

  PictureBox.Image = aMetafile;

  PictureBox.SizeMode =  PictureBoxSizeMode.StretchImage;

 }

 else PictureBox.Image = null;

}

 

You can use it in code like this:

 

LoadInImage(pictureBox1,

 wpdllInt1.Memo.GetPageAsMetafile(0,0));

 

Category

Load and Save


[idh_iwpmemo_getpageasmetafile.htm]    Copyright © 2007 by WPCubed GmbH