Class XbpMetaFile() Foundation

Class function of the XbpMetaFile class.


Objects of the XbpMetaFile() class are used to load, display and save metafiles. Metafiles contain graphic information created by the Xbase++ GRA engine. XbpMetaFile objects allow drawings to be saved in a file as a series of graphic primitives and later redisplayed by "playing back" the metafile. Metafiles are also suitable for exchanging graphic data between two work stations. Metafiles can contain bitmaps (raster images) or raster operations (see the function GraBitBlt()). If bitmaps are included, the graphic data is device dependent and exchanging graphic data between work stations with different screen resolutions and/or different numbers of display colors can lead to unexpected results.

Metafiles can be used to temporarily store data in the clipboard. They are also used to import drawings from one application into another.

An XbpMetaFile object can only load and display metafiles that were previously created and saved. The metafile contains graphic data that was recorded using an XbpFileDev object. The initial creation of a metafile always uses an XbpFileDev object that generates an XbpMetaFile object. XbpMetaFile objects can be generated in two different ways: either by a call to XbpMetaFile():new() or by the :metaFile()method of an XbpFileDev object.

Class methods
Creates an instances of the XbpMetaFile class.
Life cycle
Requests system resources for managing a metafile.
This method has no effect in the XbpMetaFile() class.
Releases the system resources of the object.
Replays the metafile in a presentation space (display the image).
Loads a metafile.
Saves graphic data in a metafile.
Sets or retrieves the graphic data in the buffer.
Initializes the metafile through an IPicture automation object.
Load and display metafiles

// This example demonstrates how metafiles can be loaded 
// and displayed. The metafiles TESTA.MET and TESTB.MET 
// must exist. The contents of both files are displayed 
// using a single XbpMetaFile object. 

   LOCAL oMF, cBuffer 

   SetColor( "N/W" )                   // Fill window pale gray 

   oMF := XbpMetaFile():new():create() // XbpMetaFile object 
   oMF:load( "TestA.met" )             // Load metafile 

   oMF:draw()                          // Display TESTA.MET 
   cBuffer := oMF:setBuffer()          // Read graphic data 

   oMF:load( "TestB.met" )             // Load TESTB.MET 
                                       // metafile 
   WAIT "oMF:setBuffer() has changed"  // Wait for keypress 

   oMF:draw()                          // Display TESTB.MET 

   WAIT "Redisplay original data, press key..." 

   oMF:setBuffer( cBuffer ) 

   WAIT                                // Wait for keypress 

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.