PlayMetaFileToHDC(Filename as string, TopX as integer, TopY as integer, ScaleX as float, ScaleY as float) as long

Description

Method converts EMF metafiles into the sprite (movieclip) and places this new sprite(movieclip) to the given depth on the scene.

You can draw directly on .hDC or play metafiles (EMF, WMF) to .hDC using PlayMetaFileToHDC method. Most WinGDI commands and EMF files are supported but to get high-quality rendering that is required for complex metafiles and drawings (reports with many objects and gradients, metafiles made by virtual printers etc) you should set HDC_HighQuality and HDC_HighQuality_UseBuffer to True (usage of high quality EMF2SWF mode requires additional "EMF2SWF High Quality License" in registered version of library)

To get size of EMF metafile (if you need to fit metafile to the movie size) please use IEMFFileInfo interface object


Example (screenshot):


See also:


Parameters

Filename - path name to EMF metafile (.emf or .wmf)
TopX - X coordinate of left-top rectangle for EMF metafile to draw
TopY - Y coordinate of left-top rectangle for EMF metafile to draw
ScaleX - scaling factor for X axis. Set 1 to draw metafile without scaling
ScaleY - scaling factor for Y axis. Set 1 to draw metafile without scaling

Result

returns index of new sprite(movieclip) object in zero-based sprites collection

Example:

Visual Basic / VBScript / ASP:

  W = 640
  H = 480
  Set Movie = CreateObject("SWFScout.FlashMovie")
  Movie.InitLibrary "demo", "demo"


' Movie creating and setting parameters

  Movie.BeginMovie 0,0,W,H,1,12,6
  Movie.Compressed = true
  Movie.SetBackgroundColor 255,255,255


  ' read information about EMF file
Set EMFFileInfo = CreateObject("SWFScout.EMFFileInfo")
EMFFileInfo.LoadFile "PrintedHTML.emf"
EMF_Width = EMFFileInfo.Width
EMF_Height = EMFFileInfo.Height
Set EMFFileInfo = nothing

  Movie.PlayMetaFileToHDC "PrintedHTML.emf", 0,0,W / EMF_Width , H / EMF_Height
  Movie.PlaceFromHDC 1

Movie.ShowFrame 1

Movie.EndMovie

Movie.SaveToFile "Metafile.swf"


C#:



C++:

Also Check Examples