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.
// 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.
PROCEDURE Main
LOCAL oMF, cBuffer
SetColor( "N/W" ) // Fill window pale gray
CLS
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
CLS
oMF:draw() // Display TESTB.MET
WAIT "Redisplay original data, press key..."
oMF:setBuffer( cBuffer )
oMF:draw()
WAIT // Wait for keypress
RETURN
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.