Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. CreateEnhMetafile (EMF) and WMF

CreateEnhMetafile (EMF) and WMF

Scheduled Pinned Locked Moved C / C++ / MFC
graphicshelpgame-devtutorialquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MikeG 0
    wrote on last edited by
    #1

    I have the following problem: I am creating an Enhanced metafile using OpenGL and then trying to convert it to a metafile (WMF). Right now I have to do the following: HDC hDCEnhMetaFile = CreateEnhMetaFile(.."myfile.emf"); ...do my drawing... CloseEnhMetaFile(hDCEnhMetaFile); ... HENHMETAFILE hEnhMetafile = GetEnhMetafile( "myfile.emf") GetWinMetafileBits( hEnhMetafile, pBuffer, numBytes ); HMETAFILE hMemMetafile = GetMetafile() hMemWinMetaFile = SetMetaFileBitsEx( numBytes, pBuffer ) hFileWinMetaFile = CopyMetaFile(hMemWinMetaFile, "myfile.wmf") DeleteMetaFile( hFileWinMetaFile ) DeleteMetaFile(hMemWinMetaFile ) DeleteEnhMetaFile( hEnhMetaFile ) I do NOT want to actually create an EMF file. The problem is the CreateEnhMetafile function returns an HDC not HENHMETAFILE which is required for GetWinMetafileBits - I tried to just cast the HDC to an HENHMETAFILE but this doesn't seem to work (invalid parameter error). Is there someway to get the HENHMETAFILE from an HDC? Any example code out there (I can't find anything)? Thanks Mike

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups